Skip to content

Commit

Permalink
fix(HistogramSelector): Expect new SVG loader behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed May 22, 2018
1 parent d4f9eca commit fea1cb0
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/InfoViz/Native/HistogramSelector/index.js
Expand Up @@ -326,11 +326,18 @@ function histogramSelector(publicAPI, model) {

if (model.provider.isA('LegendProvider') && model.singleModeName) {
const { color, shape } = model.provider.getLegend(model.singleModeName);
d3.select(model.container).select(`.${style.jsHeaderSingleField}`)
.html(`<svg class='${
style.legendSvg
}' width='${legendSize}' height='${legendSize}'
fill='${color}' stroke='black'><use xlink:href='${shape}'/></svg>`);
d3
.select(model.container)
.select(`.${style.jsHeaderSingleField}`)
.html(
`<svg class='${
style.legendSvg
}' width='${legendSize}' height='${legendSize}' viewBox='${
shape.viewBox
}' fill='${color}' stroke='black'><use xlink:href='#${
shape.id
}'/></svg>`
);
} else {
d3
.select(model.container)
Expand Down Expand Up @@ -647,8 +654,12 @@ function histogramSelector(publicAPI, model) {
const { color, shape } = model.provider.getLegend(def.name);
legendCell.html(`<svg class='${
style.legendSvg
}' width='${legendSize}' height='${legendSize}'
fill='${color}' stroke='black'><use xlink:href='${shape}'/></svg>`);
}' width='${legendSize}' height='${legendSize}' viewBox='${
shape.viewBox
}'
fill='${color}' stroke='black'><use xlink:href='#${
shape.id
}'/></svg>`);
} else {
legendCell.html('<i></i>').select('i');
}
Expand Down

0 comments on commit fea1cb0

Please sign in to comment.