Skip to content

Commit

Permalink
removes background from shape legend
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Aug 3, 2016
1 parent 42d636a commit 6e7213b
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default function(data = []) {
outerBounds = {width: 0, height: 0, x: 0, y: 0};

let align = "center",
backgroundColor = "transparent",
duration = 600,
fill = accessor("color"),
fontColor = constant("#444"),
Expand Down Expand Up @@ -101,26 +100,6 @@ export default function(data = []) {
if (select === void 0) shape.select(d3Select("body").append("svg").attr("width", `${window.innerWidth}px`).attr("height", `${window.innerHeight}px`).node());
if (lineHeight === void 0) lineHeight = (d, i) => fontSize(d, i) * 1.1;

// Background <g> Group
let bgGroup = select.selectAll("g.d3plus-legend-bg-group")
.data([0]);

bgGroup = bgGroup.enter().append("g")
.attr("class", "d3plus-legend-bg-group")
.merge(bgGroup);

// Background Rectangle
d3plusShape.rect()
.data([{id: "legend-background"}])
.duration(duration)
.fill(backgroundColor)
.height(height)
.select(bgGroup.node())
.width(width)
.x(width / 2)
.y(height / 2)
();

// Calculate Text Sizes
lineData = data.map((d, i) => {
const f = fontFamily(d, i), lh = lineHeight(d, i), s = fontSize(d, i);
Expand Down Expand Up @@ -247,15 +226,6 @@ export default function(data = []) {
return arguments.length ? (align = _, shape) : align;
};

/**
@memberof shape
@desc If a valid CSS *color* is specified, sets the overall background color to the specified value and returns this generator. If *color* is not specified, returns the current background color.
@param {String} [*color* = []]
*/
shape.backgroundColor = function(_) {
return arguments.length ? (backgroundColor = _, shape) : backgroundColor;
};

/**
@memberof shape
@desc If *value* is specified, sets the methods that correspond to the key/value pairs and returns this generator. If *value* is not specified, returns the current configuration.
Expand Down

0 comments on commit 6e7213b

Please sign in to comment.