marmelab / marmelab/EventDrops

Drop colors shift after zoom or scroll

Open
#282 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
233
PR merge metrics
No merged PRs in 30d

Description

**What you were expecting:**
When a drop's color is overridden such that drops in the same row have multiple colors, the drop colors should persist regardless of zooming or dragging.

**What happened instead:**
Zooming or dragging some drops out of view seems to shift the colors to the wrong drops.

**Steps to reproduce:**
Give drops in a row multiple colors
Zoom or scroll the right most drop out of view
Note that the colors shift left

**Related code:**


var global;
$(document).ready(function () {
console.log("ready!");

const chart = eventDrops({
drop: {
date: d => new Date(d.date),
color: d => d.color
}
});
const repositoriesData = [
{
name: 'System1',
data: [{ date: new Date('2020/03/15 14:21:31'), color: 'red' }
, { date: new Date('2020/02/15 14:21:31'), color: 'grey' }
, { date: new Date('2020/01/15 14:21:31'), color: 'grey' }
, { date: new Date('2019/05/15 14:21:31'), color: 'grey' }
, { date: new Date('2018/03/15 14:21:31'), color: 'grey' }
],
}
];

if (global === undefined) { global = window; } //Unpkg workaround

d3
.select('#eventdrops-demo')
.data([repositoriesData])
.call(chart);
});

**Other information:**
With the default scale:
![image](https://user-images.githubusercontent.com/38796590/78162278-daa21280-7403-11ea-87d5-163d9820fec2.png)

After dragging the right most drop out of range:
![image](https://user-images.githubusercontent.com/38796590/78162395-0e7d3800-7404-11ea-8525-08e45ac753ee.png)

**Environment**
* D3 version 5.15.0
* EventDrops version 1.3.0
* Browser: Any (verified in Chrome, Edge)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the inline eventDrops configuration and the supplied multi-colored drop data, then inspect the zoom and drag rendering paths in the repository. Verify that colors remain associated with their original drops after zooming or moving a drop out of view.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3js, javascript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.