Skip to content
Snippets Groups Projects
Commit 233d5b6a authored by Chris Hallberg's avatar Chris Hallberg
Browse files

PubdateVis css extraction: skip rules that don't match the color.

parent 807d77e1
No related merge requests found
...@@ -20,17 +20,22 @@ function PadDigits(n, totalDigits) ...@@ -20,17 +20,22 @@ function PadDigits(n, totalDigits)
function loadVis(facetFields, searchParams, baseURL, zooming) { function loadVis(facetFields, searchParams, baseURL, zooming) {
// Get colors from CSS // Get colors from CSS
var cssColorSettings = { var cssColorSettings = {
'background-color': '#ffffff', // background of box 'background-color': '#fff', // background of box
'fill': 'rgb(234,234,234)', // fillColor 'fill': '#eee', // box fill color
'outline-color': '#e8cfac', // selection color 'stroke': '#265680', // box outline color
'stroke': '#265680' // color 'outline-color': '#e8cfac' // selection color
}; };
var $dateVisColorSettings = $('#dateVisColorSettings'); var $dateVisColorSettings = $('#dateVisColorSettings');
for(var rule in cssColorSettings) { for(var rule in cssColorSettings) {
if($dateVisColorSettings.css(rule)) { if($dateVisColorSettings.css(rule)) {
cssColorSettings[rule] = $dateVisColorSettings.css(rule).match(/rgb[a]?\([^\)]+\)|#[a-fA-F0-9]+/)[0]; var match = $dateVisColorSettings.css(rule).match(/rgb[a]?\([^\)]+\)|#[a-fA-F0-9]+/);
if(null != match) {
cssColorSettings[rule] = match[0];
}
} }
} }
console.log($dateVisColorSettings);
console.log(cssColorSettings);
// options for the graph, TODO: make configurable // options for the graph, TODO: make configurable
var options = { var options = {
series: { series: {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment