@d3plus/vue
| Install | |
|---|---|
npm install @d3plus/vue |
|
| Latest Version: | 4.9.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 23, 2026 |
| Links: | GitHub · npm |
@d3plus/vue
Vue 3 components for d3plus visualizations.
Installing
npm install @d3plus/vue. Requires vue (^3.4) as a peer dependency.
import {Treemap} from "@d3plus/vue";
Usage
Each d3plus visualization, component, and shape is exported as a Vue component. Pass a config object (and optionally callback / forceUpdate / className):
<script setup>
import {Treemap} from "@d3plus/vue";
import {ref} from "vue";
const config = ref({
data: [
{parent: "Group 1", id: "alpha", value: 29},
{parent: "Group 2", id: "beta", value: 10},
],
groupBy: ["parent", "id"],
sum: "value",
});
</script>
<template>
<Treemap :config="config" style="height: 400px" />
</template>
The underlying instance is reused across config changes so the chart tweens between states rather than restarting, and is destroyed when the component unmounts. Reassigning config to a structurally-identical value is a no-op — set :force-update="true" to render on every update.
Global config
Provide a config object merged ahead of every component's own config (the analogue of the React wrapper's D3plusContext):
import {provide} from "vue";
import {D3plusConfigKey} from "@d3plus/vue";
provide(D3plusConfigKey, {locale: "es-ES"});
Props
| Prop | Description |
|---|---|
config |
Config object forwarded to the instance's .config() method. |
callback |
A function invoked at the end of each render cycle. |
forceUpdate |
When true, re-renders on every update even if the config is unchanged. |
className |
The wrapper <div>'s class attribute (defaults per component type). |
API Reference
createD3plusComponent(Constructor, className?) builds a component from any d3plus class, and D3plusConfigKey is the injection key for global config. All the named exports (Treemap, BarChart, Geomap, …) are built with it.
Related Packages
Nuxt module for @memotux/vue-plot — declarative data visualization with Observab...
Vue 3 and D3 components to display genomics data (genes, coverage, alignments, v...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 4.9.0 | ^3.5.44 | MIT | |
| 4.8.0 | ^3.4.0 | MIT | |
| 4.7.0 | ^3.4.0 | MIT | |
| 4.6.0 | ^3.4.0 | MIT | |
| 4.5.0 | ^3.4.0 | MIT | |
| 4.3.0 | ^3.4.0 | MIT |