@adyen/lume 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,280 @@
1
+ # Lume
2
+
3
+ [![PR workflow](https://github.com/Adyen/lume/actions/workflows/pr.yml/badge.svg)](https://github.com/Adyen/lume/actions/workflows/pr.yml)
4
+ [![MIT License](https://img.shields.io/badge/license-MIT)](https://github.com/Adyen/lume/blob/main/LICENSE)
5
+ [![Netlify Status](https://api.netlify.com/api/v1/badges/a6c48bc7-b4d2-4be4-ad36-cbd353ab4f07/deploy-status)](https://app.netlify.com/sites/adyen-lume/deploys)
6
+
7
+ 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.
8
+
9
+ > **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.
10
+
11
+ **[Design guidelines (Website)](https://lumedataviz.com/)**
12
+
13
+ - [About](#about)
14
+ - [Getting started](#getting-started)
15
+ - [Development](#development)
16
+ - [Contacts](#contacts)
17
+
18
+ ## About
19
+
20
+ ### What's different about Lume
21
+
22
+ 🧑‍🎨 Backed by strong data visualization design principles, guidelines and patterns
23
+ 🖼️ Leverages Vue for SVG rendering and reactivity
24
+ 📦 Available for both Vue 2.7 and 3
25
+
26
+ ### Stack
27
+
28
+ #### Dependencies
29
+
30
+ - [D3.js](https://d3js.org/) for calculations
31
+ - [Vue](https://vuejs.org/) for rendering
32
+ - [Popper.js](https://popper.js.org/) for tooltip functionality
33
+
34
+ #### Dev stack
35
+
36
+ - [pnpm](https://pnpm.io/) for package management
37
+ - [Vite](https://vitejs.dev/) and [Webpack](https://webpack.js.org/) for bundling
38
+ - [Sass](https://sass-lang.com/) for complex/reusable styling
39
+ - [TypeScript](https://www.typescriptlang.org/) for type checking
40
+ - [TypeScript ESLint](https://typescript-eslint.io/) for linting _(with the help of [eslint-plugin-vue](https://eslint.vuejs.org/))_
41
+ - [Storybook](https://storybook.js.org/) for developing/showcasing components
42
+ - [Vitest](https://vitest.dev/) for unit testing
43
+
44
+ ## Getting started
45
+
46
+ ### Installation
47
+
48
+ To install Lume, run the following command:
49
+
50
+ #### Vue 2.7+
51
+
52
+ ```shell
53
+ $ npm install @adyen/lume
54
+ ```
55
+
56
+ #### Vue 3
57
+
58
+ ```shell
59
+ $ npm install @adyen/lume-vue3
60
+ ```
61
+
62
+ ### Components
63
+
64
+ You can import Lume components to your Vue app:
65
+
66
+ ```ts
67
+ // SFC <script type="ts">
68
+
69
+ import { defineComponent } from 'vue';
70
+ import { LumeBarChart } from '@adyen/lume';
71
+
72
+ export default defineComponent({
73
+ components: { LumeBarChart },
74
+ ...
75
+ });
76
+ ```
77
+
78
+ ```ts
79
+ // Composition <script setup type="ts">
80
+
81
+ import { LumeBarChart } from '@adyen/lume';
82
+ ```
83
+
84
+ ### Plugin
85
+
86
+ You can also import Lume as a Vue plugin that you install in your global Vue setup:
87
+
88
+ ```ts
89
+ import Vue from 'vue';
90
+ import LumePlugin from '@adyen/lume/plugin';
91
+
92
+ import App from './my-app.vue';
93
+
94
+ Vue.use(LumePlugin);
95
+
96
+ const app = new Vue(App).$mount('#root');
97
+ ```
98
+
99
+ ### Styles
100
+
101
+ For Lume to render as intended, you also need to import its styles.
102
+
103
+ #### CSS (global)
104
+
105
+ ```ts
106
+ // app/index/main.ts
107
+ import Vue from 'vue';
108
+ import App from './my-app.vue';
109
+
110
+ // Main styles
111
+ import '@adyen/lume/styles';
112
+ // (Optional) Lume font
113
+ import '@adyen/lume/font';
114
+
115
+ const app = new Vue(App).$mount('#root');
116
+ ```
117
+
118
+ #### Sass (global)
119
+
120
+ ```ts
121
+ // app/index/main.ts
122
+ import Vue from 'vue';
123
+ import App from './my-app.vue';
124
+
125
+ // Main styles
126
+ import '@adyen/lume/scss';
127
+ // (Optional) Lume font
128
+ import '@adyen/lume/font';
129
+
130
+ const app = new Vue(App).$mount('#root');
131
+ ```
132
+
133
+ #### CSS (SFC)
134
+
135
+ ```vue
136
+ <template>...</template>
137
+
138
+ <script>
139
+ ...
140
+ </script>
141
+
142
+ <!-- Main styles -->
143
+ <style src="@adyen/lume/styles"></style>
144
+ <!-- (Optional) Lume font -->
145
+ <style src="@adyen/lume/font"></style>
146
+ ```
147
+
148
+ #### Sass (SFC)
149
+
150
+ ```vue
151
+ <template>...</template>
152
+
153
+ <script>
154
+ ...
155
+ </script>
156
+
157
+ <!-- Main styles -->
158
+ <style lang="scss" src="@adyen/lume/scss"></style>
159
+ <!-- (Optional) Lume font -->
160
+ <style src="@adyen/lume/font"></style>
161
+ ```
162
+
163
+ #### Sass (with overrides)
164
+
165
+ ```vue
166
+ <template>...</template>
167
+
168
+ <script>
169
+ ...
170
+ </script>
171
+
172
+ <!-- Main styles -->
173
+ <style lang="scss">
174
+ @use '@adyen/lume/scss' with (
175
+ $lume-font-family: 'Times New Roman'
176
+ );
177
+ </style>
178
+ ```
179
+
180
+ ## Development
181
+
182
+ You can clone this repo and use `pnpm` to install dependencies. We use Storybook to develop our features.
183
+
184
+ ### Docker
185
+
186
+ To run the app inside a Docker container:
187
+
188
+ 1. Create a `.env` file with your Docker image URL:
189
+ ```shell
190
+ $ echo DOCKER_IMAGE={YOUR_IMAGE_HERE} >> .env
191
+ ```
192
+ 2. Start your container:
193
+ ```shell
194
+ $ docker compose up -d
195
+ ```
196
+ 3. Attach to it in your terminal:
197
+ ```shell
198
+ $ docker attach lume
199
+ ```
200
+ 4. Install `pnpm`:
201
+ ```shell
202
+ $ npm i -g pnpm
203
+ ```
204
+ 5. (Optional, depends on your Docker image) Add the npm global directory to the `PATH` variable:
205
+ ```shell
206
+ $ export PATH="${PATH}:/root/local/bin"
207
+ ```
208
+
209
+ ### About Vue versions
210
+
211
+ Lume ships two packages, one for each Vue version (2 and 3).
212
+
213
+ 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.
214
+
215
+ #### Storybook
216
+
217
+ Storybook is available by running the following command:
218
+
219
+ ```shell
220
+ $ pnpm run storybook
221
+ ```
222
+
223
+ Every chart component should have its own `.stories` file, and it will be automatically loaded onto the Storybook manager.
224
+
225
+ ##### Available addons
226
+
227
+ - [`addon-essentials`](https://www.npmjs.com/package/@storybook/addon-essentials)
228
+ - [`addon-storysource`](https://www.npmjs.com/package/@storybook/addon-storysource)
229
+ - [`addon-a11y`](https://www.npmjs.com/package/@storybook/addon-a11y)
230
+
231
+ ### Releasing
232
+
233
+ To generate a release:
234
+
235
+ 1. Create a release branch and push it as upstream:
236
+ ```shell
237
+ $ git checkout -b release-[VERSION] && git push -u origin release-[VERSION]
238
+ ```
239
+ 2. Run the release command:
240
+ ```shell
241
+ $ npm run release
242
+ ```
243
+ 3. Create a PR for the release branch.
244
+ 4. After it's merged, publish the GitHub release. This will then publish the new release in NPM.
245
+
246
+ This will prompt you with an interactive CLI to create a new version, tag, changelog entry and release.
247
+
248
+ ### Roadmap
249
+
250
+ | Feature | Status |
251
+ | ----------------------------------------- | ------ |
252
+ | **Charts** | |
253
+ | Alluvial (sankey) diagram | ✅ |
254
+ | Single bar chart | ✅ |
255
+ | Grouped bar chart | ✅ |
256
+ | Stacked bar chart | ✅ |
257
+ | Horizontal orientation for all bar charts | ✅ |
258
+ | Line chart | ✅ |
259
+ | Sparkline chart | ✅ |
260
+ | **Features** | |
261
+ | A11y colors | 🚧 |
262
+ | A11y guidelines & impl. | ❌ |
263
+ | Dark theme | ❌ |
264
+ | Select dataset in legend | ❌ |
265
+
266
+ ✅ - Done
267
+ 🚧 - WIP
268
+ ❌ - To do
269
+
270
+ ## Contacts
271
+
272
+ ### Maintainers
273
+
274
+ - Govind Srinidhi | [@govind-srinidhi](https://github.com/govind-srinidhi)
275
+ - Joao Santos | [@joao-m-santos](https://github.com/joao-m-santos)
276
+
277
+ ### Contributors
278
+
279
+ - Lucas van Heerikhuizen | [@Lucas1981](https://github.com/Lucas1981)
280
+ - Vivian Joseph | [@vivy27](https://github.com/vivy27)