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

Not rendering d3 charts. #153

Open
mkok1019 opened this issue Sep 7, 2017 · 1 comment
Open

Not rendering d3 charts. #153

mkok1019 opened this issue Sep 7, 2017 · 1 comment

Comments

@mkok1019
Copy link

mkok1019 commented Sep 7, 2017

I am going to render d3 charts into PDF but it doesn't work.

Actually, I've tested that javascript is running for PDF export, but it doesn't support async callback.

I've described here how it doesn't work on my side.

d3.queue()
    .defer(d3.json, "https://s3.amazonaws.com/xxx.json")
    .defer(d3.json, dataUrl)
    .defer(d3.tsv, "https://s3.amazonaws.com/xxx.tsv")
    .await(ready);

Before this code block, I've confirmed that JS is running correctly. After this code block, I put some JS testing code, but it didn't work and its not coming into PDF.

Can anyone help for this, please?

@Freakazo
Copy link

Freakazo commented Nov 2, 2017

Hey @mkok1019,

Can you try setting

    cmd_options = {
        'javascript-delay': 6000,
    }

The above will wait 6 seconds for the javascript to finish.

Better yet if you can make your javascript emit a string when the page is ready to be captured.

    cmd_options = {
        'javascript-delay': 6000,
        'window-status': 'myrandomstring'
    }

See passing cmd_options and discussion on ajax

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

2 participants