
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
generator-politico-graphics
Advanced tools
A Yeoman generator that scaffolds a development environment for building reusable graphic modules.
Building data visualizations is expensive, especially for small teams balancing graphics with other development work. At POLITICO, we want to build our charts using patterns that promote reusability and that make them easy to integrate in multiple contexts.
This framework builds on the reusable chart pattern proposed by Mike Bostock in "Toward Reusable Charts," adding to it a few conventions borrowed from reactive programming and modern JS modules. It helps us create chart modules that have simple, declarative APIs and can be easily configured for different uses.
That's the theory. In practice, this framework helps us separate the concerns of dataviz development from other client-side work. We've used it as a shortcut to build dozens of complex data visualization components and reusable chart modules over several years.
Make sure you have node, the yarn package manager, yeoman and this generator installed:
$ npm install -g yarn yo generator-politico-graphics
This generator can also create a GitHub repo for you while it's building out your development environment. Export an environment variable with a Github personal access token to GITHUB_TOKEN
. The generator will then ask whether you'd like to create a repo with each new build.
Create a fresh directory for your project and move into it in a terminal window.
$ mkdir my-new-graphic
$ cd my-new-graphic
Now run the generator and answer the questions it asks to build your dev environment.
$ yo politico-graphics
Start the development server.
$ yarn start
The generator includes a basic example of a reusable chart module in src/js/lib/Chart.js
. Start there to build your chart.
The README included when you run the generator includes many tips for using this reusable pattern. Read it!
Once you're ready to publish your module, run:
$ yarn build
From here you can commit your code to GitHub and host the preview page using GitHub pages or publish your module to NPM.
FAQs
Generator for developing graphic modules at POLITICO.
The npm package generator-politico-graphics receives a total of 0 weekly downloads. As such, generator-politico-graphics popularity was classified as not popular.
We found that generator-politico-graphics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.