What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pass the dataset from Node.js to the browser with Puppeteer’s page.evaluate(), then update the mounted React application so the data reaches the React-Vis series component’s data prop. Wait for an application-specific signal that the chart has rendered before taking a screenshot or PDF. A Node.js variable is not automatically available in page JavaScript, and React-Vis does not provide a built-in Puppeteer bridge.

How the data gets from Node.js to React-Vis

There are three separate parts to this integration:

  1. Node prepares the rows. For a line series, use serializable records such as { x: 1, y: 12 }.
  2. Puppeteer transfers them into the page. Pass the array as an argument to page.evaluate(). Puppeteer evaluates the callback in the browser context and transfers its arguments there.
  3. The page updates React state or props. A page-side function hands the rows to the mounted application. The React-Vis series receives them through its ordinary data prop.

Keep the chart update inside the React application. Do not try to pass a React component, state setter, or Node object directly across the Node/browser boundary. The boundary carries serializable data; the page’s own code decides how that data changes the UI.

Wire an update function into the React application

The following is a React-side pattern, not a universal drop-in component: connect it to the root and imports used by your project. The important pieces are state owned by the mounted app, a page-accessible function that updates that state, and a completion flag set after React commits the update.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import React, { useEffect, useState } from 'react';
import { XYPlot, XAxis, YAxis, LineSeries } from 'react-vis';

export function ChartApp() {
  const [rows, setRows] = useState([]);
  const [renderComplete, setRenderComplete] = useState(false);

  useEffect(() => {
    // Puppeteer calls this function in the page context.
    window.updateChartData = (nextRows) => {
      setRenderComplete(false);
      setRows(nextRows);
    };

    return () => {
      delete window.updateChartData;
    };
  }, []);

  useEffect(() => {
    // This runs after React commits the render that uses the current rows.
    // Add any app-specific asynchronous work before setting this to true.
    setRenderComplete(true);
  }, [rows]);

  useEffect(() => {
    window.chartRenderComplete = renderComplete;
  }, [renderComplete]);

  return (
    <div id="chart-root">
      <XYPlot width={700} height={400}>
        <XAxis />
        <YAxis />
        <LineSeries data={rows} />
      </XYPlot>
    </div>
  );
}

The example uses hooks to illustrate the wiring. If your application uses a different React version, root setup, or state-management approach, implement the same contract with the APIs your app already uses. React-Vis series components expect a data array of objects; the exact chart, dimensions, and fields depend on your chart design. For a line series, the project’s example uses x and y values.

The completion flag above means React has committed a render following the state change. It does not automatically prove that unrelated asynchronous work—such as fonts, images, transitions, or data fetched by the app—has finished. If the chart depends on any of those, set the signal only after that work is complete, or wait for an observable chart-specific condition instead.

Send data and capture the rendered page with Puppeteer

Here is the Node-side sequence. It assumes your page has already loaded the app containing window.updateChartData. Replace the navigation URL with your app’s URL and supply the actual chart data. The example waits for the app’s ready function, sends the rows as an argument, waits for the completion signal, and then captures the page.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
import puppeteer from 'puppeteer';

const data = [
  { x: 1, y: 12 },
  { x: 2, y: 19 },
  { x: 3, y: 15 },
];

const browser = await puppeteer.launch({ headless: true });

try {
  const page = await browser.newPage();
  await page.goto('http://localhost:3000/chart', {
    waitUntil: 'domcontentloaded',
  });

  // Wait until the React app has installed its page-side bridge.
  await page.waitForFunction(() => typeof window.updateChartData === 'function');

  // The data argument is transferred into the browser page context.
  await page.evaluate((rows) => {
    window.chartRenderComplete = false;
    window.updateChartData(rows);
  }, data);

  // Wait for the app to report that the chart's update has committed.
  await page.waitForFunction(() => window.chartRenderComplete === true);

  await page.screenshot({ path: 'chart.png', fullPage: true });
} finally {
  await browser.close();
}

page.evaluate() can return a value or a Promise; Puppeteer waits for a returned Promise to resolve. In this example, it returns as soon as the synchronous update function has been called, so the separate waitForFunction() is essential. The Puppeteer wait has its own default timeout; set an explicit timeout if your application needs a different limit, and handle a timeout as a failed or incomplete render rather than silently capturing whatever happened to appear.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate and shape the data before sending it

Arguments passed through browser evaluation must be transferable values. Keep the payload to plain data such as arrays, strings, numbers, booleans, and objects composed of those values. A function, a React element, or a class instance is not a substitute for sending chart rows. Convert dates to an agreed representation before transfer if your page expects actual date objects, and reconstruct them in the page when necessary.

Check that each row has the fields the series expects and that numeric values are actually numbers. Missing or malformed coordinates can lead to an empty or misleading chart even though the bridge itself succeeded. If the dataset is large, avoid logging or repeatedly serializing it in application code; send only the fields the chart needs.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Choose a completion condition that matches the chart

  • Use an app-owned flag when your React component controls all work required to render the chart. Set it after the state update has been committed.
  • Wait for a chart-specific DOM condition when there is a stable marker or expected rendered element you can observe. Puppeteer provides selector waits; its current interaction guidance recommends locators for element interactions because they wait for the element to be present and in an appropriate state.
  • Include asynchronous dependencies if the chart uses fetched data, transitions, or assets. A React commit alone does not mean those later operations are complete.

Network idleness and a fixed sleep can be useful in a particular app, but neither is proof that this chart’s update finished. Prefer a condition tied to the app’s actual rendering work.

Capture a screenshot or PDF after the update

Once the chart-specific wait completes, use page.screenshot() for an image or page.pdf() for a PDF. The page must be laid out at the viewport and dimensions you want to capture; configure those before sending the data if the chart’s size depends on the viewport.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// Image, after the chart completion wait:
await page.screenshot({ path: 'chart.png', fullPage: true });

// PDF, after the chart completion wait:
await page.pdf({ path: 'chart.pdf', printBackground: true });

Puppeteer’s PDF output uses print CSS media by default. If the PDF should use screen-media styles instead, call await page.emulateMediaType('screen') before page.pdf(). This can affect chart colors, layout, and dimensions, so check the output against the intended print or screen styling.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Common failures and fixes

Symptom Likely cause Fix
window.updateChartData is not a function Puppeteer called the bridge before the React app installed it, or the app did not mount on the page being automated. Wait for the function to exist before evaluating the update. Confirm the navigation URL and that the expected app bundle loaded.
The page evaluation succeeds but the chart stays unchanged The function may not update the state or props used by the mounted series, or the rows may have the wrong shape. Connect the bridge to the app’s normal state update path, pass a new array, and verify that the series receives the resulting rows through its data prop.
The screenshot is blank or shows the old chart The capture happened before the state-driven render or another visual dependency completed. Wait for a render signal that is set after the update, and extend that signal to cover any asynchronous work your chart requires.
waitForFunction() times out The page never set the expected condition, the bridge threw an error, or rendering did not finish before the wait expired. Inspect browser console and page errors, verify the flag’s spelling and update path, and choose a timeout appropriate to the app while keeping failure visible.
Data appears in the wrong order or with missing points Rows may be missing required coordinates, contain nonnumeric values, or be transformed differently than expected. Validate representative input rows in Node and inspect the values received by the page before capture.
The PDF differs from the screenshot PDF generation defaults to print media, which can activate different CSS. Use print styles intentionally or emulate screen media before generating the PDF.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

React-Vis maintenance caveat

This pattern is most useful when maintaining an application that already uses React-Vis. The React-Vis project’s deprecation notice says the library has no active maintainers and will receive no patches or new features. That is an important maintenance risk for a new project; Puppeteer’s data handoff does not change the chart library’s support status. If you keep React-Vis, account for the possibility that compatibility fixes and new capabilities will need to come from your own team or another maintained solution.

Or skip the browser setup

ScreenshotNeo can capture a URL as an image or PDF, but it does not replace the page.evaluate() bridge that passes runtime data into a React app. Use it when the page is already reachable with the chart rendered; for data that exists only in your Node process, keep the Puppeteer update flow above.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request details. ScreenshotNeo removes known cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up free for 1,000 screenshots a month, with no card required.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Frequently Asked Questions

Can Puppeteer pass a React setter directly from Node.js?

No. Keep the setter in the browser app and expose a page-side function that calls it; send only the dataset through Puppeteer.

Does React-Vis accept chart rows through a `data` prop?

Yes. Its series components, including `LineSeries`, take an array of data objects through that prop.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.