Skip to content

Commit

Permalink
fix(all): Fix possible IE9 style value
Browse files Browse the repository at this point in the history
- Make element's css value to be string
- Revert on 
5463150#diff-851f1a6e431d0ae7dc68b646d27821a8R90-R93

Ref #1059
  • Loading branch information
netil authored Sep 2, 2019
1 parent 046f9db commit 950c335
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/plugin/stanford/Elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export default class Elements {
// exit
stanfordLine.exit().transition()
.duration(duration)
.style("opacity", 0)
.style("opacity", "0")
.remove();

// enter
const stanfordLineEnter = stanfordLine.enter().append("g");

stanfordLineEnter.append("line")
.style("opacity", 0);
.style("opacity", "0");

stanfordLineEnter
.merge(stanfordLine)
Expand All @@ -62,7 +62,7 @@ export default class Elements {
.attr("y1", d => (isRotated ? xvCustom(d, "x1") : yvCustom(d, "y1")))
.attr("y2", d => (isRotated ? xvCustom(d, "x2") : yvCustom(d, "y2")))
.transition()
.style("opacity", 1);
.style("opacity", "1");
}

updateStanfordRegions(duration) {
Expand All @@ -82,18 +82,18 @@ export default class Elements {
// exit
stanfordRegion.exit().transition()
.duration(duration)
.style("opacity", 0)
.style("opacity", "0")
.remove();

// enter
const stanfordRegionEnter = stanfordRegion.enter().append("g");

stanfordRegionEnter.append("polygon")
.style("opacity", 0);
.style("opacity", "0");

stanfordRegionEnter.append("text")
.attr("transform", isRotated ? "rotate(-90)" : "")
.style("opacity", 0);
.style("opacity", "0");

stanfordRegion = stanfordRegionEnter.merge(stanfordRegion);

Expand All @@ -108,7 +108,7 @@ export default class Elements {
isRotated ? xvCustom(value, "x") : yvCustom(value, "y")
].join(",")).join(" "))
.transition()
.style("opacity", d => (d.opacity ? d.opacity : 0.2));
.style("opacity", d => String(d.opacity ? d.opacity : 0.2));

stanfordRegion.select("text")
.transition()
Expand All @@ -127,7 +127,7 @@ export default class Elements {
.attr("text-anchor", "middle")
.attr("dominant-baseline", "middle")
.transition()
.style("opacity", 1);
.style("opacity", "1");
}

updateStanfordElements(duration = 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/shape/arc.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ extend(ChartInternal.prototype, {
mainArc = mainArc.enter().append("path")
.attr("class", $$.classArc.bind($$))
.style("fill", d => $$.color(d.data))
.style("cursor", d => hasInteraction && (config.data_selection_isselectable(d) ? "pointer" : null))
.style("cursor", d => (hasInteraction && config.data_selection_isselectable(d) ? "pointer" : null))
.style("opacity", "0")
.each(function(d) {
if ($$.isGaugeType(d.data)) {
Expand Down
6 changes: 4 additions & 2 deletions src/shape/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ extend(ChartInternal.prototype, {
(withTransition ? $$.mainArea.transition(getRandom()) : $$.mainArea)
.attr("d", drawArea)
.style("fill", $$.updateAreaColor.bind($$))
.style("opacity", d => ($$.isAreaRangeType(d) ? $$.orgAreaOpacity / 1.75 : $$.orgAreaOpacity))
.style("opacity", d => String($$.isAreaRangeType(d) ? $$.orgAreaOpacity / 1.75 : $$.orgAreaOpacity))
];
},

Expand Down Expand Up @@ -539,8 +539,10 @@ extend(ChartInternal.prototype, {

$$.mainCircle.exit().remove();

const fn = $$.point("create", this, $$.pointR.bind($$), $$.color);

$$.mainCircle = $$.mainCircle.enter()
.append($$.point("create", this, $$.pointR.bind($$), $$.color))
.append(fn)
.merge($$.mainCircle)
.style("stroke", $$.color)
.style("opacity", $$.initialOpacityForCircle.bind($$));
Expand Down
8 changes: 4 additions & 4 deletions src/shape/point.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ extend(ChartInternal.prototype, {
$$.insertPointInfoDefs(point, pointId);
}

if (/^(create|update)$/.test(method)) {
method === "create" && args.unshift(pointId);

return $$.custom[method].bind(context)(element, ...args);
if (method === "create") {
return $$.custom.create.bind(context)(element, pointId, ...args);
} else if (method === "update") {
return $$.custom.update.bind(context)(element, ...args);
}
}

Expand Down

0 comments on commit 950c335

Please sign in to comment.