Comments (5)
a simplified variant of this has been implemented. thanks for the suggestion & PoC! 💯
interestingly, this optimization does not save the same 12ms off the cold start render time - that only drops by ~2ms (out of ~45ms).
from uplot.
hey @1wheel , this looks pretty sweet. i actually saw this technique buried in some chart lib's docs with a bunch of caveats just a few days ago. i'm trying to find where i saw it and it's driving me nuts!
something similar here: https://www.amcharts.com/docs/v4/concepts/performance/#Simplifying_paths
thanks for the demo! unless you want to take a stab at this impl in uPlot, i'm going to focus on some of the other todos first and revisit this later. you know what they say about premature optimization 🤣
EDIT: ah, here we go [1], but it's not really talking about line charts, just column and bar chart rects all being 1px wide. tangentially related.
[1] https://www.highcharts.com/docs/advanced-chart-features/boost-module
from uplot.
@1wheel i did a basic test of this strategy in another branch [1] and it does indeed shave about 50% off the render time. toggling a series on/off (which is a full rescale/redraw) went from ~23ms -> ~12ms. i'm using fillRect()
calls at the pixel boundaries rather than lineTo()
at +0.5
offsets. fillRect handles 1x1 sizes more naturally, too.
i don't have any gap-filling logic there yet, so at higher zoom levels it's just dots.
[1] https://github.com/leeoniya/uPlot/tree/reduce-lineTo
from uplot.
btw, i think i nabbed the cold-start issue in 9d71ac9. i'm guessing it was a V8 de-opt due to some stuff ending up as NaN
s as a result of declared but undefined vars at the start of the drawing loop.
from uplot.
oh interesting!
from uplot.
Related Issues (20)
- add new "justify" scale type
- custom markers HOT 1
- the tooltip stick to points
- Tooltip issue #question
- fix mouse interaction performance for 2,000 series HOT 1
- base 2 ranging and ticks without log scale
- Secondary sync demos not working HOT 6
- Ranger selection does not trigger mousemove event. HOT 5
- Click event on chart is 'destroying' existing selection
- Is it possible to create stacked bar charts that are grouped by year ? HOT 2
- what would be an approach to make groups of series? HOT 1
- Can I hide an axis but not the ortho lines? HOT 5
- Solution for adding padding within the canvas itself? HOT 2
- Setting Legend Markers using Paths HOT 1
- Seeking guidance on creating a dynamic chart with the following features HOT 2
- how do set bar with in uplot HOT 1
- Best practice to avoid clipped axis ticks' labels HOT 2
- Can we render Multicolor Bar charts(each bar has different color) using uPlot? HOT 5
- lineInterpolation not working HOT 1
- Set data array read position in options to enable circular buffered data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uplot.