question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Canvas components] allow to get the canvas

See original GitHub issue

Is your feature request related to a problem? Please describe. The problem is to export graphs into png

Describe the solution you’d like A neat way to export canvas is to use toDataURL web api of canvas. To do this I need to be able to access the canvas. The solutions i am seeing are:

  • allow users to use ref and forward it to canvas.
  • if this is not possible because of how refs are used internally then provide a function getCanvas that gives back the current canvas ref
  • worst solution, allow user to add an id tag that will be then able to query using document.getElementById

Describe alternatives you’ve considered Haven’t considered but open to suggestions

Additional context I am willing to do the changes myself via a PR, just interested in knowing what an acceptable solution is to you so i don’t do this in vein 😃

And if you arrived here, thanks for maintaining this awesome library

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bobylitocommented, Oct 30, 2020

Hi everybody,

I’m working with the Orbit team (@phacks and @dzello) on this topic. Thanks to the earlier discussion, I have something working already for the Line chart (see https://github.com/orbit-love/nivo/commit/8bd3a7e92f9c9ac91f7623054bdc3757af796651)

I’d like your feedback on the solution:

  • am I doing something too much with the refs? 😅
  • do you think there is a way to generalize the solution to all the charts? (I’m OK with custom code everywhere too)

Right now we don’t need charts beyond the lines and bars, does it make sense to provide this feature to all canvas based components? Would a PR with only the lines and bars be accepted?

Thanks for your time 😃

0reactions
stale[bot]commented, Feb 5, 2021

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Canvas component overview (contains video) - Power Apps
Components are reusable building blocks for canvas apps so that app makers can create custom controls to use inside an app, or across...
Read more >
Canvas Components - Braze
With Canvas components, you can unlock new user journeys to improve your process and increase the effectiveness of your audience outreach.
Read more >
The Graphics Canvas element - HTML - MDN Web Docs
Use the HTML element with either the canvas scripting API or the WebGL API to draw graphics and animations.
Read more >
Field Admin Console Canvas Components
This document discusses the four Canvas Component fields that can be set within a case in the Admin Console. These fields allow Field...
Read more >
Components on the JavaScript Canvas | by Dr Abstract | Medium
The Button component gets mousedown or click events but most of the other components have a change event. Let's try a few out....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found