Skip to content

Commit

Permalink
Dim background when a crew is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwalley committed Dec 22, 2016
1 parent 8daf882 commit 163c1ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-bumps-chart",
"version": "0.3.1",
"version": "0.3.2",
"description": "Draw bumps charts.",
"keywords": [
"d3",
Expand Down
6 changes: 4 additions & 2 deletions src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function () {
const widthWithoutLines = 310;
const initialViewBoxX = -165;
const initialViewBoxY = 0;
const transitionLength = 500;
const transitionLength = 400;
const startLabelPosition = 0;
const finishLabelPosition = 4;
const numbersLeftPosition = -8;
Expand Down Expand Up @@ -227,12 +227,14 @@ export default function () {
.style('filter', d => (d.highlighted || d.hover ? 'url(#dropShadow)' : ''))
.style('fill', 'none')
.style('stroke', d => (d.highlighted || d.hover ? crewColor(d.name) : '#000000'))
.style('stroke-width', d => (d.highlighted || d.hover ? '3px' : '2px'));
.style('stroke-width', d => (d.highlighted || d.hover ? '3px' : '2px'))
.style('stroke-opacity', d => selectedCrews.size > 0 ? (d.highlighted || d.hover ? '1' : '0.5') : '1');

crew.classed('highlighted', d => d.highlighted)
.style('filter', d => (d.highlighted || d.hover ? 'url(#dropShadow)' : ''))
.style('stroke', d => (d.highlighted || d.hover ? crewColor(d.name) : '#000000'))
.style('stroke-width', d => (d.highlighted || d.hover ? '3px' : '2px'))
.style('stroke-opacity', d => selectedCrews.size > 0 ? (d.highlighted || d.hover ? '1' : '0.5') : '1')
.transition()
.duration(transitionLength)
.attr('transform', `translate(${x(-dayShift)},0)`);
Expand Down

0 comments on commit 163c1ba

Please sign in to comment.