Skip to content
Snippets Groups Projects
Commit c4806850 authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Firefox did not react well to the viewbox changing. When I completely...

Firefox did not react well to the viewbox changing. When I completely recreated the legend svg the issue described in WDFN-172 went away in Firefox.
parent d37b9c92
No related branches found
No related tags found
No related merge requests found
...@@ -164,11 +164,10 @@ const plotSvgDefs = function(elem) { ...@@ -164,11 +164,10 @@ const plotSvgDefs = function(elem) {
const timeSeriesLegend = function(elem) { const timeSeriesLegend = function(elem) {
elem.append('div') elem.append('div')
.classed('hydrograph-container', true) .classed('hydrograph-container', true)
.append('svg') .call(link(drawSimpleLegend, createStructuredSelector({
.call(link(drawSimpleLegend, createStructuredSelector({ legendMarkerRows: legendMarkerRowsSelector,
legendMarkerRows: legendMarkerRowsSelector, layout: layoutSelector
layout: layoutSelector })));
})));
}; };
......
...@@ -71,8 +71,8 @@ const createLegendMarkers = function(displayItems) { ...@@ -71,8 +71,8 @@ const createLegendMarkers = function(displayItems) {
* @param {Object} legendMarkerRows - Array of rows. Each row should be an array of legend markers. * @param {Object} legendMarkerRows - Array of rows. Each row should be an array of legend markers.
* @param {Object} layout - width and height of svg. * @param {Object} layout - width and height of svg.
*/ */
function drawSimpleLegend(svg, {legendMarkerRows, layout}) { function drawSimpleLegend(div, {legendMarkerRows, layout}) {
svg.selectAll('.legend').remove(); div.selectAll('.legend-svg').remove();
if (!legendMarkerRows || !layout) { if (!legendMarkerRows || !layout) {
return; return;
...@@ -83,6 +83,8 @@ function drawSimpleLegend(svg, {legendMarkerRows, layout}) { ...@@ -83,6 +83,8 @@ function drawSimpleLegend(svg, {legendMarkerRows, layout}) {
const verticalRowOffset = 18; const verticalRowOffset = 18;
const markerTextXOffset = 10; const markerTextXOffset = 10;
let svg = div.append('svg')
.attr('class', 'legend-svg')
let legend = svg let legend = svg
.append('g') .append('g')
.attr('class', 'legend') .attr('class', 'legend')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment