Skip to content

Conversation

@francobottero
Copy link

It's important to say that events have to go on a separate TimeSeries than the rest of the data or else, they will interfere with the chart.
Events will look something like this :
changes

Copy link
Collaborator

@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice feature, but as it stands this PR cannot be merged. It removes a bunch of functionality others depend upon. I also think the implementation could be improved to have better performance, as discussed in comments below.

Comment on lines +909 to +934
if (typeof dataSet[i][1] === 'string' ) {
context.moveTo(x, 0);
context.lineTo(x, dimensions.height);
context.fillStyle = seriesOptions.strokeStyle;
context.fillText(dataSet[i][1], x + 5, 10);
} else {
context.moveTo(x, y);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than do this type check on every point on every series, it'd be clearer and faster to create a new series type for these events.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the function be exactly the same ? I just think it doubles the code unnecessarily

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The final outcome would be the same, but it's a lot more work to test the type on every single point on all series. Smoothie is light and fast. Currently this cost would be paid by everyone, regardless of whether they use these events. Using a new SmoothieEventSeries type avoids that cost.

@francobottero francobottero force-pushed the master branch 2 times, most recently from c1820e6 to b542507 Compare November 26, 2019 17:15
@cinderblock
Copy link

@francobottero Have you considered updating this to use a separate TimeSeries type? I for one would like to see this feature added.

@drewnoakes
Copy link
Collaborator

@cinderblock feel free to create a new PR if you have the bandwidth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants