
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@antv/g2-ssr
Advanced tools
This extension package provides SSR support for G2 5.0, which supports canvas rendering in server side.
npm install @antv/g2-ssr
For complete options, please refer to G2 Spec
import { createChart } from '@antv/g2-ssr';
const chart = await createChart({
width: 640,
height: 480,
imageType: 'png', // or 'jpeg'
// chart spec
});
chart.exportToFile('chart');
// -> chart.png
chart.toBuffer();
// -> get buffer
npx g2-ssr export -i [chart-spec].json -o ./chart
When render in JavaScript API, you can pass outputType option to export SVG or PDF.
const chart = await createChart({
width: 640,
height: 480,
outputType: 'svg', // or 'pdf'
// chart spec
});
When render in CLI, you can pass -t or --type option to export SVG or PDF.
When using G2-SSR, you can also use G render plugins. Here's how to use plugins in server-side rendering:
import { createChart } from '@antv/g2-ssr';
import { Plugin as RoughCanvasPlugin } from '@antv/g-plugin-rough-canvas-renderer';
const chart = await createChart({
width: 500,
height: 500,
renderPlugins: [new RoughCanvasPlugin()],
data: {
// data
},
});
npx g2-ssr export -i [chart-spec].json -o ./file -t pdf
MIT
FAQs
Support SSR for G2
The npm package @antv/g2-ssr receives a total of 303 weekly downloads. As such, @antv/g2-ssr popularity was classified as not popular.
We found that @antv/g2-ssr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 75 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.