Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is probably a better performing way for point show false #2853

Open
efeskucuk opened this issue Oct 3, 2021 · 0 comments
Open

There is probably a better performing way for point show false #2853

efeskucuk opened this issue Oct 3, 2021 · 0 comments

Comments

@efeskucuk
Copy link

efeskucuk commented Oct 3, 2021

C3 version: 0.5.4
D3 version: 4.13.0
Browser: Chromium (Not sure about version)
OS: Windows

My versions are outdated but I went through the source code of the project I believe my statement is still true. When a chart is generated like so,


var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 50, 20, 10, 40, 15, 25]
        ]
    },
    point: {
        show: false
    }
});

Library adds this to all circle elements in html,

element {
    opacity: 0;
}

When there are a lot of circles (We use this library to generate PDF files and on our charts it can go up to 86.400 points), RAM usage of the browser at least triples and our PDF generations fail after that so I don't know how worse it can go. What I did to get around this was add

display: none;

to the parent element of the circles which in my case was,

<g class="c3-shapes c3-shapes-Intensity c3-circles c3-circles-Intensity" style="cursor: pointer;">

I am not familiar with the entire codebase so I'm not sure if my solution would bring more problems, do you think this method could be better than the one library currently applies?

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

No branches or pull requests

1 participant