
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@abcnews/palette
Advanced tools
Principles:
Goal:
This describes the functions and objects available in the module and how to use them for generating or importing colour palettes.
Returns an array of hex colour strings for use in visualising nominal (non-ordinal) categorical data for the given number of categories.
getNominalCategoricalPalette: (n: number) => string[]
Emphasis and de-emphasis colours can be used for palettes where there are up to four categories.
getEmphasisColours: () => {emphasise: string, deemphasise: string}
Returns an array of hex colour strings for use in visualising ordinal categorical data for the given number of categories.
getOrdinalCategoricalPalette: (n: number, variant: 'blue'|'red'|'green'|'purple' = 'blue') => string[]
A generic function for accessing the palettes described below.
getNamedCategoricalPalette: (name: 'gender'|'sentiment'|'political') => GenderPalette | SentimentPalette | PoliticalPalette
Returns a palette for use when visualising gender categories.
getGenderPalette: () => GenderPalette
Returns a palette for use when visualising sentiment.
getSentimentPalette: () => SentimentPalette
Returns a palette for use when visualising political parties.
getPoliticalPalette: () => PoliticalPalette
Continuous and divergent palettes are provided as an interpolation function that takes a value between 0 and 1 and returns a hex RGB colour string. These are similar to the diverging and sequential schemes provided by d3 in the d3-scale-chromatic package.
These are suited for use with a scale function where an input domain appropriate for the data you're visualising is mapped to a normalised output range between 0 and 1.
An easy way to use these is with d3's sequential and diverging scale functions. Unlike most of d3's scale functions these take an interpolation function in place of a range.
const scale = d3.scaleSequential(getContinuousPalette('blue')).domain([0, 100]);
Returns a continuous scale function for generating colours for an input value. Functions expect a value between 0 and 1.
getContinuousPaletteInterpolator: (variant: 'blue'|'red'|'green'|'purple' = 'blue') => (value: number) => string
Returns a continuous scale function for generating colours for an input value. Functions expect a value between 0 and 1.
getDivergentPaletteInterpolator: (variant: 'rb'|'gp'|'pr' = 'rb') => (value: number) => string
sveltekit package
doesn't output CSS.Everything you need to build a Svelte project, powered by create-svelte
;
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npm init svelte@next
# create a new project in my-app
npm init svelte@next my-app
Note: the
@next
is temporary
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Before creating a production version of your app, install an adapter for your target environment. Then:
npm run build
You can preview the built app with
npm run preview
, regardless of whether you installed an adapter. This should not be used to serve your app in production.
FAQs
Principles:
We found that @abcnews/palette demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.