You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rendering a Vega chart on the server-side using React can be a bit tricky because Vega (and Vega-Lite) relies on browser-specific APIs (like the DOM) to render charts. The renderToStaticMarkup function from react-dom/server renders components to static HTML and doesn't execute any client-side code or lifecycle methods, which is why your Vega chart isn't appearing.
However, you can achieve server-side rendering (SSR) by using a workaround that involves pre-rendering the chart on the server and then hydrating it on the client.
I want to render in the server a react page that includes a Vega chart. Is this possible?
At the moment the example code only returns an empty div.
<div style="width:100%;height:100%;min-height:300px"/>
Server
Component
The text was updated successfully, but these errors were encountered: