Comments (1)
Fixed, but now the commented out clause around the "draw
" callback makes the graph disappear:
const chart = fc
.chartCartesian(xScale, yScale)
.canvasPlotArea(gridline)
.webglPlotArea(candlesticks)
.decorate((sel) => {
sel
.enter()
.select('.webgl-plot-area')
.raise()
.on('measure', event => {
const { width, height } = event.detail;
xScale.range([0, width]);
yScale.range([height, 0]);
gl = container.querySelector('canvas').getContext('webgl');
candlesticks.context(gl);
})
.on('click', () => {
const domain = xScale.domain();
const mid = (domain[1].valueOf() - domain[0].valueOf()) / 2;
xScale.domain([domain[0], new Date(domain[1].valueOf() - mid)]);
candlesticks.bandwidth(candlesticks.bandwidth()() * 2);
container.requestRedraw();
})
.on('measure.bandwidth', (event, d) => { // statically updates bandwidth measure on screen stretch
const { width } = event.detail;
candlesticks.bandwidth(width/100.0);
})
// .on('draw', () => {
// if (pixels == null) {
// pixels = new Uint8Array(
// gl.drawingBufferWidth * gl.drawingBufferHeight * 4
// );
// }
// performance.mark(`draw-start-${frame}`);
// candlesticks(data);
// // Force GPU to complete rendering to allow accurate performance measurements to be taken
// gl.readPixels(
// 0,
// 0,
// gl.drawingBufferWidth,
// gl.drawingBufferHeight,
// gl.RGBA,
// gl.UNSIGNED_BYTE,
// pixels
// );
// performance.measure(`draw-duration-${frame}`, `draw-start-${frame}`);
// frame++;
// })
})
d3.select('#chart')
.datum(data)
.call(chart);
container.requestRedraw();
from d3fc.
Related Issues (20)
- Question: Zoom Extent HOT 3
- Question: Infinity vertical line aligned to time value HOT 1
- Webgl points series rendering below gridlines. HOT 2
- Crosshair it comes side of stack bar series instead of in the middle as in simple bar series
- When using WebGL to render Chart, calling Brush will report an error.
- Animating WebGL Series HOT 1
- Nextjs transpilation error. HOT 4
- Solved! Zoom / Pan a streaming chart with code example HOT 1
- Is it compatible with d3.js v7.6.1?
- ES module version
- Drawing seriesWebGlLine for big values doesn't draw correctly, seriesCanvasLine is fine HOT 1
- Is a node version bump in the works?
- Migrate to GH actions HOT 2
- Label Rotate start too late, after they start overlapping HOT 1
- Line series points the side of bar series instead of in the middle bar series. HOT 3
- Error with Sveltkit HOT 2
- on click and hover event in series-webgl-bar HOT 2
- GitHub releases are not working HOT 1
- Problems with integrating d3fc charts as a webcomponent in React application (Shadow DOM)
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 d3fc.