Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@adyen/lume-vue3

Adyen588MIT1.11.3TypeScript support: included

Lume is a Vue data visualization component library, built with Typescript and D3.

Lume, LumeJS, Lume Design System, Data Visualization, Charts, d3.js, SVG charts, Bar charts, Single bar chart, Grouped bar chart, Stacked bar chart, Sparkline chart, Line chart, Alluvial charts, Sankey diagrams, Vue chart library, Vue, Vue 2.7

readme

Lume

PR workflow MIT License Netlify Status

Lume is a combination of a set of design guidelines for creating data visualizations that tell stories, and a component library that implements them, built for Vue applications.

Note: Lume ships two packages - one that is compatible with Vue 2.7, and another, with Vue 3. The second is published as @adyen/lume-vue3. Our examples import the Vue 2.7-compatible version, but if you're using Vue 3, just update the import name.

Design guidelines (Website)

About

What's different about Lume

🧑‍🎨 Backed by strong data visualization design principles, guidelines and patterns
🖼️ Leverages Vue for SVG rendering and reactivity
📦 Available for both Vue 2.7 and 3

Stack

Dependencies

Dev stack

Getting started

Installation

To install Lume, run the following command:

Vue 2.7+

$ npm install @adyen/lume

Vue 3

$ npm install @adyen/lume-vue3

Components

You can import Lume components to your Vue app:

// SFC <script type="ts">

import { defineComponent } from 'vue';
import { LumeBarChart } from '@adyen/lume';

export default defineComponent({
  components: { LumeBarChart },
  ...
});
// Composition <script setup type="ts">

import { LumeBarChart } from '@adyen/lume';

Plugin

You can also import Lume as a Vue plugin that you install in your global Vue setup:

import Vue from 'vue';
import LumePlugin from '@adyen/lume/plugin';

import App from './my-app.vue';

Vue.use(LumePlugin);

const app = new Vue(App).$mount('#root');

Styles

For Lume to render as intended, you also need to import its styles.

CSS (global)

// app/index/main.ts
import Vue from 'vue';
import App from './my-app.vue';

// Main styles
import '@adyen/lume/styles';
// (Optional) Lume font
import '@adyen/lume/font';

const app = new Vue(App).$mount('#root');

Sass (global)

// app/index/main.ts
import Vue from 'vue';
import App from './my-app.vue';

// Main styles
import '@adyen/lume/scss';
// (Optional) Lume font
import '@adyen/lume/font';

const app = new Vue(App).$mount('#root');

CSS (SFC)

<template>...</template>

<script>
...
</script>

<!-- Main styles -->
<style src="@adyen/lume/styles"></style>
<!-- (Optional) Lume font -->
<style src="@adyen/lume/font"></style>

Sass (SFC)

<template>...</template>

<script>
...
</script>

<!-- Main styles -->
<style lang="scss" src="@adyen/lume/scss"></style>
<!-- (Optional) Lume font -->
<style src="@adyen/lume/font"></style>

Sass (with overrides)

<template>...</template>

<script>
...
</script>

<!-- Main styles -->
<style lang="scss">
@use '@adyen/lume/scss' with (
  $lume-font-family: 'Times New Roman'
);
</style>

Development

You can clone this repo and use pnpm to install dependencies. We use Storybook to develop our features.

Docker

To run the app inside a Docker container:

  1. Create a .env file with your Docker image URL:
      $ echo DOCKER_IMAGE={YOUR_IMAGE_HERE} >> .env
  2. Start your container:
      $ docker compose up -d
  3. Attach to it in your terminal:
      $ docker attach lume
  4. Install pnpm:
      $ npm i -g pnpm
  5. (Optional, depends on your Docker image) Add the npm global directory to the PATH variable:
      $ export PATH="${PATH}:/root/local/bin"

About Vue versions

Lume ships two packages, one for each Vue version (2 and 3).

Development is done in Vue 3, keeping in mind that the same source code must work the same way on both Vue versions, so some of the new Vue 3 APIs are restricted, unless provided with a fallback.

Storybook

Storybook is available by running the following command:

$ pnpm run storybook

Every chart component should have its own .stories file, and it will be automatically loaded onto the Storybook manager.

Available addons

Releasing

To generate a release:

  1. Create a release branch and push it as upstream:
      $ git checkout -b release-[VERSION] && git push -u origin release-[VERSION]
  2. Run the release command:
      $ npm run release
  3. Create a PR for the release branch.
  4. After it's merged, publish the GitHub release. This will then publish the new release in NPM.

This will prompt you with an interactive CLI to create a new version, tag, changelog entry and release.

Roadmap

Feature Status
Charts
Alluvial (sankey) diagram
Single bar chart
Grouped bar chart
Stacked bar chart
Horizontal orientation for all bar charts
Line chart
Sparkline chart
Features
A11y colors 🚧
A11y guidelines & impl.
Dark theme
Select dataset in legend

✅ - Done
🚧 - WIP
❌ - To do

Contacts

Maintainers

Contributors

changelog

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

1.11.4

  • ⏪️ Revert "Convert bar transform-origin to rem" 0eb3300

1.11.3

17 December 2024

  • 🚀 Updated peer dependency of vue in Lume Vue 3 package e17944d

1.11.2

11 November 2024

  • Bump vite from 4.5.2 to 4.5.5 48d68c9
  • ⬆️ Update storybook monorepo 1d381b3
  • :arrow_up: Bump vitest from 0.34.6 to 2.1.1 f62a5ba

1.11.1

12 September 2024

  • 🐛 Assume null data as empty f92ba7e

1.11.0

2 September 2024

1.10.3

12 July 2024

  • 🐛 Fix type declaration exports 0781e5a

1.10.2

20 June 2024

  • 🐛 Horizontal bar charts without minimum size not calculating height on initial render b9818ca

1.10.1

24 May 2024

  • ⬆️ Update dependency sass to v1.76.0 214cd83
  • 📝 Update bar-sparkline playground example 38e4fb9
  • 🐛 Convert bar transform-origin to rem 810ffb3

1.10.0

25 April 2024

  • 💄 Update various Lume styles 268fcfb

1.9.5

4 April 2024

  • 🏷️ Improve DX of exported types and add the missing types. 387774a
  • 🏷️ Exported utils types for better DX eef5e4a
  • 🏷️ Reusing different bar variants from all bar types 64dd24d

1.9.3

14 March 2024

  • 🐛 Fix lume-tooltip use v-if instead of v-show 9ece713
  • ✅ Fix unit tests 203feb0

1.9.2

14 March 2024

  • ⬆️ Update dependency vite to v4.5.2 9eec45a
  • ⬆️ Bump dependency versions df201ce
  • 📝 Remove h1 title from README to integrate in docs website 09b56d4

1.9.1

19 January 2024

  • 🐛 Add missing color values in constants 7bbf38b

1.9.0

19 January 2024

  • ✨ Add update event for hoveredIndex ecfa912
  • 🚸 Improve lume-tooltip usability by introducing opened prop e76fa5a
  • ✅ Update LumeChart unit tests f534a3b

1.8.0

16 January 2024

  • ✨ Add lume-alluvial-node-header component 8cbfbf2
  • 🔧 Add triage label to issue templates c4e9771
  • 🩹 Fix the horizontal stacked bar chart default options 6f32ccf

1.7.0

11 January 2024

  • 🐛 Fix empty data/labels handling d5dca98
  • 🐛 Fix wrong assumption on external hover ca3f936
  • ✨ Introduce inverse property/option in lume-tooltip f510005

1.6.5

11 December 2023

  • 🐛 Fix alluvial node min. height in derived nodes d71b702
  • 🐛 Fix unhandled line-group null value cases 909b672
  • 🐛 Make skip option reactive eefa96e

1.6.3

27 November 2023

  • 🐛 Reverted wrongly checked-in lock file 0d94181
  • 🐛 Fix add default value to isEmpty inject c35a3d9

1.6.2

27 November 2023

  • 🐛 Handled missing data in lume charts 11a4d1a
  • ✅ Fixed tests to check for the null bar values. 52b777b
  • 🔧 Ignore release commits in changelog 3ca31bb

1.6.1

24 November 2023

  • 🐛 Fix wrong types file path 9f152dc

1.6.0

23 November 2023

  • 🏷️ Reintroduce type declarations; Fix TS errors 439e336
  • ✨ Add nodeLabelMaxWidth option to alluvial ea40c45
  • 🚸 Replacing the error with warning if index is not present in group. 4667c03

1.5.3

21 November 2023

  • 📝 Update homepage in pkg.jsons 07edbcb
  • 📝 Add description to pkg.jsons 2448430
  • 🐛 External hover to check all items before marking index as invalid fe6ee75

1.5.2

21 November 2023

  • 📌 Change vue peerDependencies versions 5e4cc70

1.5.1

21 November 2023

  • 🐛 Creating tooltip anchors equal to chart labels 0848177

1.5.0

20 November 2023

  • ⬆️ Update storybook monorepo to v7.5.2 6337521
  • ⬆️ Update vue monorepo 473c633
  • ⬆️ Update dependency webpack to v5.89.0 006f790

1.4.0

14 November 2023

  • ✨ Event propagation updates Vue 2 internal events ef6ab54
  • ⬆️ Update storybook monorepo to v7.5.0 f46fa11
  • 🔥 Remove old issue templates ea5d81f

1.3.0

6 November 2023

  • 🐛 Added support for grouped charts with varied data points. 7a2d90c

1.2.1

2 November 2023

  • 📝 Fix Readmes in packages b14b74e
  • 🐛 Fix event emission for Vue 2 a590ad2
  • ✨ Add event bus to events composable (for Vue 2 internal events) 681a1cc

1.2.0

2 October 2023

  • ✅ Updated stories/tests to depict tooltip behavior 98d348e
  • 📝 updated doc on tooltip event behavior aad1416
  • ✨ Enabling pointer events in Lume tooltip 5fe5be9

1.1.0

27 September 2023

1.0.0

25 September 2023

v0.10.0

8 September 2023

  • ⬆️ Update dependency prettier to v2.8.8 dbf2de8
  • ⬆️ Upgrade package versions & fix them f0d5037
  • ⬆️ Update storybook monorepo to v7.3.0 f405c71

v0.9.1

31 August 2023

  • ♻️ Refactor Bar chart stories; Fix related issues 7bc63f8
  • ♻️ Refactor all other stories to CSF3 08b1196
  • 🎨 Improve Alluvial link ID code 1ad631d

v0.9.0

23 August 2023

  • 🔧 Move from npm to pnpm bcb724d
  • ⬆️ Update vitest monorepo to ^0.33.0 898b1fe
  • 📝 Refined stories for all lume charts 30692f3

v0.8.0

14 July 2023

  • ✨ Add option to switch order of Alluvial labels/values 3322cf2

v0.7.1

13 July 2023

  • 🐛 Add formatted value to Alluvial node slot f164c8b
  • 🐛 Change <tex>t tag to <g> to allow better customization 57783a5
  • 🐛 Corrected missing CSS for x-axis title 58fc466

v0.7.0

13 July 2023

  • ✨ Add support for Alluvial gradient; Add focused state b5216da
  • ✨ Include node text slots in Alluvial 1747e71
  • ✨ Allow for custom curve functions in Alluvial links 3cc5de1

v0.6.1

20 June 2023

  • 🐛 Fix padding handling for all band scales 8b89cfa
  • 🐛 Fix tooltip styles and components exports 6953100
  • ✅ Remove unnecessary assertion 41f6786

v0.6.0

20 June 2023

  • ✨ Add granular tooltip elements & slot support ee46749
  • ✨ Introduce hoveredIndex/Element props 4d227ff
  • 📝 Update documentation to reflect hover props 26b958a

v0.5.3

9 May 2023

  • 🐛 Fix node headers wrong order c4fb75e

v0.5.2

8 May 2023

  • 🐛 Hover on the chart is not showing the popover 5051ff3

v0.5.1

26 April 2023

  • 📝 Add missing fields in vue2/vue3 package.json c471177

v0.5.0

26 April 2023

  • ✨ Add nodeHeaders option to Alluvial 2423d51
  • ✨ Provide part/total values for Alluvial valueFormat 13c0c01
  • 🐛 Fix unable to set withPoints through options c915a41

v0.4.0

5 April 2023

  • ✅ Update & add tests for Events API 73b5e9c
  • 🚧 Monorepo structure work in progress d000c0a
  • 📝 Update core components' documentation with Events API ec34035

v0.3.3

28 February 2023

  • 🐛 Fix chart ID not being unique + tooltip anchor issues 8391edf
  • ✅ Update & fix unit tests 9fdc431
  • 🩹 Add fallback for tooltipAnchorAttributes provide/inject de06702

v0.3.2

22 February 2023

  • 🐛 Add missing sequential colors enum 2325c36
  • 🐛 Add missing header chart legend slot fbfa8cd

v0.3.1

20 February 2023

  • 🐛 Fix duplicated keys in tooltip anchors df072c6

v0.3.0

15 February 2023

  • 🔨 Authenticate with NPM only when needed #144
  • ✨ Add full path highlighting to Alluvial 991ccd5
  • ♻️ Refactor tooltip anchor logic 64e2fa0
  • 📝 Update alluvial diagram documentation 3a704e9

v0.2.1

1 February 2023

  • 🐛 Fix repeated label scaleBand issue #149
  • 🩹 Fix wrong import path in component stories #148
  • 🎨 Code clean-up #139
  • 🚚 Move constants to @/utils/ #141
  • ♻️ Refactor Alluvial diagram and its sub-elements b8f810a
  • ♻️ Refactor group components into script setup a4089b1
  • ♻️ Abstract lume-alluvial-path-group to lume-alluvial-group 1afa447

v0.2.0

18 January 2023

  • 🐛 Fix axis grid lines not updating on size change #138
  • 💄 Add other colors (green, orange, red) #136
  • 💚 Fix vitest config #140
  • 🔧 Update release config to create draft Github releases #133
  • ⬆️ Update vitest monorepo to ^0.27.0 #132
  • ✨ Introduce script setup #121
  • ⬆️ Update dependency d3 to v7.8.0 #118
  • ⬆️ Update dependency vite-plugin-static-copy to ^0.13.0 #117
  • ⬆️ Update vitest monorepo to ^0.26.0 #126
  • ✨ add script setup to core components 3af8d6f
  • ✨ add script setup to chart components 5abe8e7
  • ✅ fix failing tests b713d44

v0.1.9

10 January 2023

  • 🐛 Fix skipped tick label hover logic #128
  • 🧑‍💻 Remove issue reference commit requirement #129
  • 🧑‍💻 Add commit message check for conventions #125
  • 🔀 122 automate releases #123
  • 🐛 Fix skipped tick label hover logic #127
  • 📝 Add CHANGELOG.md 35b4bae
  • 👷 Remove bump-version workflow; Update npm-publish workflow 865ce66
  • 🔧 Update changelog generation config 68357a9

v0.1.8

30 December 2022

  • 🐛 Fix color logic for cases when color is defined in the dataset #119
  • 🔧 Add commit prefix to renovate config #116
  • ✨ Introduce summary item in LumeTooltip #113
  • 🧑‍💻 Add Dockerfile, compose & guide #114

v0.1.7

30 November 2022

  • ✨ Make sure portals are scoped to component by using a unique id gene… #108
  • ✨ Tooltip should have an option to format value #110
  • ♻️ Rough setup to move out the logic from the line and line-group co… #103
  • ✨ Introduce vitest for test #101
  • ♻️ Use portal to broker for the chart legend in the lume chart compo… #97
  • 📝 docs: add quick link for navigation #104
  • ✨ Introduce format composable 44f50fa
  • 🔥 remove jest and istanbul config files d75c882
  • ♻️ Use portal to broker for the chart legend in the lume chart component #96 f8d5653

v0.1.6

23 November 2022

  • 🐛 Add chart ID to fix portal names issue #100
  • ✨ Add option to control line width #98
  • ♻️ Use computed properties; Sort properties b2c6d29
  • ♻️ Refactor showAxes option to withAxes 3d4f5a8
  • 📝 Update legacy color references to new colors 0319e04

v0.1.5

22 November 2022

  • Configure Renovate #83
  • 🐛 Fix axis ticks not displaying #91
  • Mr/main/lucasv/changing the case for consts in lume bar chart #89
  • 🔧 gitignore package-lock.json 41df3dc
  • 📝 Added documentation for alluvial chart a6d34df
  • 📝 Added doccumentation for the bar chart component 8f07819

v0.1.4

21 November 2022

  • 📝 Added README.md for lume chart legend #82
  • 🚸 Improve axis tick display on hover #68
  • 🎨 Make orientation optional and don't make it a prop for the alluvial… #85
  • ⏪️ Rollback Storybook config to use Webpack #84
  • 👷 Change build tool to Vite #79
  • 🔀 Mr/main/lucasv/added documentation for lume line #81
  • 📝 Documentation for lume-point component #80
  • ⬆️ Bump @types/d3-sankey from 0.11.2 to 0.12.0 #76
  • ⬆️ Bump webpack from 5.74.0 to 5.75.0 #77
  • ⬆️ Bump @typescript-eslint/parser from 5.42.1 to 5.43.0 #78
  • ⬆️ Bump eslint from 8.26.0 to 8.27.0 #74
  • ⬆️ Bump sass-loader from 8.0.2 to 13.2.0 #73
  • ⬆️ Bump jest-environment-jsdom from 29.2.2 to 29.3.1 #72
  • 📝 Mocked base data for real time charts #67
  • ⬆️ Bump loader-utils from 1.4.0 to 1.4.2 #70
  • ⬆️ Bump @typescript-eslint/parser from 5.42.0 to 5.42.1 #56
  • ⬆️ Bump jest and @types/jest #71
  • ⬆️ Bump @vue/vue2-jest from 29.1.1 to 29.2.0 #59
  • 👷 Add cleanup postbuild script; Inline font assets #69
  • 📝 Updated the storybook mock data #66
  • ✅ Restore outcome of the unit tests for the scales spec #64
  • 🎨 Small improvement proposal to the axis component and its constituen… #61
  • 📝 invert bar chart options upon orientation change #29
  • 🔥 Remove different symbols for lume-tooltip #54
  • 📝 Added figma links to the chart stories #53
  • :arrow_up: Bump jest and @types/jest 1bf2360
  • 👷 Improve build scripts; Add webpack build for font.css f959b2f
  • 📝 Add performance comparison playground example 27bd956

v0.1.3

3 November 2022

  • 💄 Update styles to allow for typography customization #52
  • ⬆️ Bump d3-color and d3 #51
  • 📌 Pin d3 version 5f7d289
  • :arrow_up: Bump d3-color and d3 b7ff046
  • 📝 Update imports in docs; Remove Storybook mdx syntax from md files 1ba924d

v0.1.2

1 November 2022

  • 👷 add git config #50
  • ✨ Included tooltip slots in chart components so that they can be overridden by the consumers #36
  • 🔀 39 Allow for custom tooltip targetElement #44
  • Add d3 package to fix jest errors #37
  • 🔀 41 add option to set/remove chart background color #43
  • ⬆️ Bump jest and @types/jest #33
  • ⬆️ Bump @types/node from 17.0.45 to 18.11.5 #35
  • ⬆️ Bump d3-shape from 2.1.0 to 3.1.0 #34
  • ⬆️ Bump d3-format from 1.4.5 to 3.1.0 #31
  • ⬆️ Bump jest-environment-jsdom from 29.2.1 to 29.2.2 #30
  • ⬆️ Upgrade jest/ts-jest versions fa20f20
  • :arrow_up: Bump jest and @types/jest ebaf222
  • ⬆️ Upgrade dependencies; Remove unused deps; Minor tsconfig fix 18313f7

0.1.1

24 October 2022

  • ✨ Provide options to customize bar paddings #27
  • ⬆️ Bump css-loader from 3.6.0 to 6.7.1 #23
  • ⬆️ Bump babel-jest from 28.1.3 to 29.2.0 #24
  • ⬆️ Bump jest-environment-jsdom from 28.1.3 to 29.2.0 #21
  • 💚 fix broken test in github action #19
  • ⏪ add back the md version issue templates #17
  • 💄 Update typography styles #15
  • 🎨 enhance issue templates #13
  • 👷 Add npm publish script (dry) #14
  • ♻️ Move overlay logic to new adv-overlay-group component #12
  • Bumped testing versions and suspended some tests that need more attention #11
  • Added test for adv-chart, refactored out shared resources for the other tests,... #9
  • Rename axis to adv-axis; Remove any from axis types #10
  • Refactor core bar component #8
  • Refactor, rename & remove bar-related components #6
  • Refactor, rename & remove line-related components #7
  • Added adv-bar-group #5
  • Replace any with Scale type #4
  • adv-axis #3
  • VID-2616 Migrate to Storybook 6 #2
  • VID-2617 Migrate to Composition API / TypeScript #1
  • ⬆️ Update dependency configs 5fae939
  • 🚚 Move charts, core & groups to src/components directory 4c3b094
  • 🚚 Move spec files to same dir of what they're testing e50c9a6