If you prefer Yarn, use the following command instead:
yarn add -D @carbon/charts-svelte
The required styles should be imported from @carbon/charts-svelte/styles.css.
SvelteKit
While this component library can be used with any build environments for Svelte,
SvelteKit is the official framework for building Svelte apps supporting
client-side and server-side rendering (SSR). SvelteKit is powered by Vite.
The module @carbon/charts should not be externalized for SSR when building for production.
Dynamically import a chart and instantiate it using the
svelte:component API. By importing
@carbon/charts within onMount(), you avoid problems with server-side rendering.
Use the ComponentProps utility type from svelte to extract the props for chart components.
You can then use an
indexed access type to
extract types for individual properties.
import { typeComponentProps } from'svelte'import { BarChartSimple } from'@carbon/charts-svelte'typeChartProps = ComponentProps<BarChartSimple>
// Indexed access type to access the type of the `chart` propertyletchart: ChartProps['chart'] = null
IBM Telemetry
This package uses IBM Telemetry to collect metrics data. By installing this package as a dependency
you are agreeing to telemetry collection. To opt out, see
Opting out of IBM Telemetry data collection.
For more information on the data being collected, please see the
IBM Telemetry documentation.
We found that @carbon/charts-svelte demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 16 Sep 2024
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.
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
By Kush Pandya, Philipp Burckhardt, Kirill Boychenko, Orlando Barrera - Oct 31, 2024
The npm package for the LottieFiles Player web component was hit with a supply chain attack after a software engineer's npmjs credentials were compromised.