Jump to content

Best way to extract a very large container/sprite


Wilco93
 Share

Recommended Posts

Hi Guys,

I am working on a large scale interactive data visualization dashboard using the latest version of Pixi. For this project I am aiming to support IE11, and the latest versions of the popular browsers.

As of now I am stuck on extracting/exporting the bar chart, which can easily contain a thousand rows (and uses a self made scrollbar).

A bar chart basically is a container and a row in the chart is a sprite with a height of 30px.

I tried the following approach: 

 

However, I am limited by the maximum size of the canvas. (see here: https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element).

For now I am considering building new containers (< max height of the canvas) and filling them with row sprites. However, I would prefer to export the chart as a single file.

Does anyone have ideas as to how they would approach this? 

Thanks a lot!

Wilco

 

Link to comment
Share on other sites

Am I understanding correctly that you want to export an image of a chart that is larger than the size of the canvas that is rendering it?

If that is what you want, I don't think there are going to be good web apis to help you here. What you would need to do is render different rectangles of the chart which you composite together into an image format. unfortunately, if your site is remote there isn't a good way to do that. 

Link to comment
Share on other sites

On 9/7/2018 at 8:37 PM, xerver said:

Am I understanding correctly that you want to export an image of a chart that is larger than the size of the canvas that is rendering it?

If that is what you want, I don't think there are going to be good web apis to help you here. What you would need to do is render different rectangles of the chart which you composite together into an image format. unfortunately, if your site is remote there isn't a good way to do that. 

Yup that's exactly right.

My Container is larger than the canvas size in the DOM, and potentionally also larger than the maximal canvas size of all major browsers.

I was mostly wondering whether another approach would be better. Like, can I circumvent using the canvas, which is the limiting factor here, at all?

However, I decided that this approach is probably the easiest after all. (filling containers and rendering them on the fly while exporting)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...