vega-embed icon indicating copy to clipboard operation
vega-embed copied to clipboard

feat: Add a logger to embed init options

Open challet opened this issue 4 years ago • 7 comments

Add an option to the embed function. It allows to pass a custom logger to the view.

challet avatar Aug 04 '21 14:08 challet

We should also pass the logger to Vega-Lite.

Isn't it already done since the part that adds the logger works with both Vega and Vega-Lite specs ? The mode having been guessed a few lines before.

challet avatar Aug 05 '21 15:08 challet

I don't think it is. We call compile in the preprocessor in https://github.com/vega/vega-embed/pull/732/files#diff-b0761852e43b4566f7d72f8bc18bc1a7fd5db43c5ad1d9dfcc4529afe86d0174R108. But we are not passing the logger in (docs at https://vega.github.io/vega-lite/usage/compile.html#javascript). Could you update the code to make it work? I think the best would probably be to remove the preprocessor variable and just conditionally call vl.compile on the spec.

domoritz avatar Sep 17 '21 01:09 domoritz

@challet can you finish up the pull request?

domoritz avatar Jan 20 '22 01:01 domoritz

@domoritz sorry it went out of my scope. I haven't added a test for the last change though and I will have a closer look at it.

challet avatar Jan 31 '22 17:01 challet

Thank you. Can you make sure the test pass?

domoritz avatar Feb 01 '22 02:02 domoritz

Ping @challet

domoritz avatar Feb 09 '22 22:02 domoritz

Sorry, I will have a look in the next days.

challet avatar Feb 09 '22 23:02 challet