@icij/murmur-next 4.0.0

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.
Files changed (296) hide show
  1. package/.github/workflows/deploy-github-pages.yaml +50 -0
  2. package/.storybook/app.scss +14 -0
  3. package/.storybook/doc_variables.scss +20 -0
  4. package/.storybook/main.ts +35 -0
  5. package/.storybook/preview-head.html +2 -0
  6. package/.storybook/preview.ts +32 -0
  7. package/README.md +71 -0
  8. package/deploy.js +15 -0
  9. package/docs/components/ApiTable.vue +171 -0
  10. package/docs/components/App.vue +146 -0
  11. package/docs/components/CollapsibleBlock.vue +122 -0
  12. package/docs/components/DocsHeader.vue +68 -0
  13. package/docs/components/DocsMenu.vue +201 -0
  14. package/docs/components/DocsMenuSection.vue +109 -0
  15. package/docs/components/EditLink.vue +49 -0
  16. package/docs/components/OutboundLink.vue +13 -0
  17. package/docs/components/PalettePresenter.vue +96 -0
  18. package/docs/components/RepositoryLink.vue +28 -0
  19. package/docs/components/SampleCard.vue +119 -0
  20. package/docs/main.js +42 -0
  21. package/docs/pages/components/accordion/doc.md +96 -0
  22. package/docs/pages/components/active-text-truncate/doc.md +44 -0
  23. package/docs/pages/components/advanced-link-form/doc.md +105 -0
  24. package/docs/pages/components/brand/doc.md +30 -0
  25. package/docs/pages/components/brand-expansion/doc.md +70 -0
  26. package/docs/pages/components/confirm-button/doc.md +91 -0
  27. package/docs/pages/components/content-placeholder/doc.md +16 -0
  28. package/docs/pages/components/custom-pagination/doc.md +61 -0
  29. package/docs/pages/components/digits-input/doc.md +28 -0
  30. package/docs/pages/components/donate-form/doc.md +20 -0
  31. package/docs/pages/components/embed-form/doc.md +22 -0
  32. package/docs/pages/components/embeddable-footer/doc.md +60 -0
  33. package/docs/pages/components/follow-us-popover/doc.md +5 -0
  34. package/docs/pages/components/generic-footer/doc.md +21 -0
  35. package/docs/pages/components/generic-header/doc.md +24 -0
  36. package/docs/pages/components/haptic-copy/doc.md +27 -0
  37. package/docs/pages/components/imddb-header/doc.md +23 -0
  38. package/docs/pages/components/ordinal-legend/doc.md +44 -0
  39. package/docs/pages/components/range-picker/doc.md +86 -0
  40. package/docs/pages/components/responsive-iframe/doc.md +13 -0
  41. package/docs/pages/components/scale-legend/doc.md +65 -0
  42. package/docs/pages/components/secret-input/doc.md +12 -0
  43. package/docs/pages/components/selectable-dropdown/doc.md +156 -0
  44. package/docs/pages/components/sharing-options/doc.md +13 -0
  45. package/docs/pages/components/sharing-options-link/doc.md +36 -0
  46. package/docs/pages/components/sign-up-form/doc.md +13 -0
  47. package/docs/pages/components/slide-up-down/doc.md +28 -0
  48. package/docs/pages/components/textured-deck/doc.md +78 -0
  49. package/docs/pages/components/tiny-pagination/doc.md +92 -0
  50. package/docs/pages/datavisualisation/bars/doc.md +110 -0
  51. package/docs/pages/datavisualisation/columns/doc.md +165 -0
  52. package/docs/pages/datavisualisation/lines/doc.md +139 -0
  53. package/docs/pages/datavisualisation/stacked-bar/doc.md +160 -0
  54. package/docs/pages/datavisualisation/stacked-column/doc.md +191 -0
  55. package/docs/pages/getting-started/about-icij/doc.md +13 -0
  56. package/docs/pages/getting-started/custom-bootstrap/doc.md +36 -0
  57. package/docs/pages/getting-started/installation-guide/doc.md +59 -0
  58. package/docs/pages/getting-started/internationalization/doc.md +74 -0
  59. package/docs/pages/maps/choropleth-map/doc.md +420 -0
  60. package/docs/pages/maps/choropleth-map-annotation/doc.md +373 -0
  61. package/docs/pages/maps/symbol-map/doc.md +203 -0
  62. package/docs/pages/structure/breakpoints/doc.md +3 -0
  63. package/docs/pages/structure/grid/doc.md +3 -0
  64. package/docs/pages/utilities/assets/doc.md +138 -0
  65. package/docs/pages/utilities/config/doc.md +52 -0
  66. package/docs/pages/utilities/iframes/doc.md +3 -0
  67. package/docs/pages/visual/colors/doc.md +31 -0
  68. package/docs/pages/visual/iconography/doc.md +56 -0
  69. package/docs/pages/visual/states/doc.md +77 -0
  70. package/docs/pages/visual/themes/doc.md +3 -0
  71. package/docs/pages/visual/typography/doc.md +71 -0
  72. package/docs/routes.js +25 -0
  73. package/docs/store/index.js +21 -0
  74. package/docs/styles/app.scss +36 -0
  75. package/docs/styles/variables.scss +20 -0
  76. package/lib/assets/images/icij-full-white.svg +6 -0
  77. package/lib/assets/images/icij-full.svg +6 -0
  78. package/lib/assets/images/icij.png +0 -0
  79. package/lib/assets/images/icij.svg +46 -0
  80. package/lib/assets/images/icij@2x.png +0 -0
  81. package/lib/assets/images/murmur-dark.png +0 -0
  82. package/lib/assets/images/murmur-dark.svg +79 -0
  83. package/lib/assets/images/murmur-white.png +0 -0
  84. package/lib/assets/images/murmur-white.svg +68 -0
  85. package/lib/components/AccordionStep.vue +128 -0
  86. package/lib/components/AccordionWrapper.vue +138 -0
  87. package/lib/components/ActiveTextTruncate.vue +258 -0
  88. package/lib/components/AdvancedLinkForm.vue +273 -0
  89. package/lib/components/Brand.vue +150 -0
  90. package/lib/components/BrandExpansion.vue +237 -0
  91. package/lib/components/ConfirmButton.vue +204 -0
  92. package/lib/components/ContentPlaceholder.vue +100 -0
  93. package/lib/components/CustomPagination.vue +225 -0
  94. package/lib/components/DigitsInput.vue +180 -0
  95. package/lib/components/DonateForm.vue +367 -0
  96. package/lib/components/EmbedForm.vue +173 -0
  97. package/lib/components/EmbeddableFooter.vue +201 -0
  98. package/lib/components/Fa.js +3 -0
  99. package/lib/components/FollowUsPopover.vue +117 -0
  100. package/lib/components/GenericFooter.vue +218 -0
  101. package/lib/components/GenericHeader.vue +259 -0
  102. package/lib/components/HapticCopy.vue +256 -0
  103. package/lib/components/ImddbHeader.vue +336 -0
  104. package/lib/components/OrdinalLegend.vue +164 -0
  105. package/lib/components/RangePicker.vue +430 -0
  106. package/lib/components/ResponsiveIframe.vue +48 -0
  107. package/lib/components/ScaleLegend.vue +230 -0
  108. package/lib/components/SecretInput.vue +132 -0
  109. package/lib/components/SelectableDropdown.vue +368 -0
  110. package/lib/components/SharingOptions.vue +230 -0
  111. package/lib/components/SharingOptionsLink.vue +259 -0
  112. package/lib/components/SignUpForm.vue +181 -0
  113. package/lib/components/SlideUpDown.vue +131 -0
  114. package/lib/components/TexturedDeck.vue +101 -0
  115. package/lib/components/TinyPagination.vue +268 -0
  116. package/lib/components/index.js +31 -0
  117. package/lib/composables/chart.ts +182 -0
  118. package/lib/composables/resizeObserver.ts +37 -0
  119. package/lib/composables/sendEmail.ts +50 -0
  120. package/lib/config.default.ts +33 -0
  121. package/lib/config.ts +70 -0
  122. package/lib/d3-geo-projection.d.ts +1 -0
  123. package/lib/datavisualisations/BarChart.vue +275 -0
  124. package/lib/datavisualisations/ColumnChart.vue +527 -0
  125. package/lib/datavisualisations/LineChart.vue +274 -0
  126. package/lib/datavisualisations/StackedBarChart.vue +614 -0
  127. package/lib/datavisualisations/StackedColumnChart.vue +640 -0
  128. package/lib/datavisualisations/index.js +5 -0
  129. package/lib/enums.ts +25 -0
  130. package/lib/i18n.ts +16 -0
  131. package/lib/keys.ts +2 -0
  132. package/lib/locales/en.json +140 -0
  133. package/lib/locales/fr.json +117 -0
  134. package/lib/locales/locales/en.json +140 -0
  135. package/lib/locales/locales/fr.json +117 -0
  136. package/lib/main.ts +87 -0
  137. package/lib/maps/ChoroplethMap.vue +825 -0
  138. package/lib/maps/ChoroplethMapAnnotation.vue +336 -0
  139. package/lib/maps/SymbolMap.vue +628 -0
  140. package/lib/maps/index.js +3 -0
  141. package/lib/querystring-es3.d.ts +1 -0
  142. package/lib/shims-bootstrap-vue.d.ts +5 -0
  143. package/lib/shims-tsx.d.ts +11 -0
  144. package/lib/shims-vue.d.ts +14 -0
  145. package/lib/styles/functions.scss +20 -0
  146. package/lib/styles/lib.scss +19 -0
  147. package/lib/styles/mixins.scss +37 -0
  148. package/lib/styles/utilities.scss +18 -0
  149. package/lib/styles/variables.scss +94 -0
  150. package/lib/styles/variables_dark.scss +1 -0
  151. package/lib/types.ts +46 -0
  152. package/lib/utils/animation.ts +24 -0
  153. package/lib/utils/assets.ts +46 -0
  154. package/lib/utils/clipboard.ts +41 -0
  155. package/lib/utils/iframe-resizer.ts +49 -0
  156. package/lib/utils/placeholder.ts +66 -0
  157. package/lib/utils/placeholderTypes.ts +21 -0
  158. package/lib/utils/strings.ts +8 -0
  159. package/loaders/highlight-loader.js +13 -0
  160. package/loaders/markdown-loader.js +91 -0
  161. package/loaders/metadata-loader.js +18 -0
  162. package/loaders/sass-extract-loader.js +14 -0
  163. package/loaders/vue-docgen-loader.js +14 -0
  164. package/package.json +96 -0
  165. package/plugins/MdPluginTypes.ts +10 -0
  166. package/plugins/docs.ts +50 -0
  167. package/plugins/front-matter.ts +36 -0
  168. package/plugins/highlight.ts +27 -0
  169. package/plugins/markdown-it/api-table.ts +25 -0
  170. package/plugins/markdown-it/sample-card.ts +31 -0
  171. package/plugins/plugin-delete.ts +47 -0
  172. package/plugins/plugin-docgen.ts +23 -0
  173. package/plugins/sass-vars.ts +25 -0
  174. package/plugins/vue-docgen.ts +29 -0
  175. package/public/android-chrome-192x192.png +0 -0
  176. package/public/android-chrome-512x512.png +0 -0
  177. package/public/apple-touch-icon.png +0 -0
  178. package/public/assets/img/arrow-bottom.svg +3 -0
  179. package/public/assets/img/texture-brick-black.jpg +0 -0
  180. package/public/assets/img/texture-brick.jpg +0 -0
  181. package/public/assets/img/texture-carbon-black.jpg +0 -0
  182. package/public/assets/img/texture-carbon.jpg +0 -0
  183. package/public/assets/img/texture-crack-black.jpg +0 -0
  184. package/public/assets/img/texture-crack.jpg +0 -0
  185. package/public/assets/img/texture-rock-black.jpg +0 -0
  186. package/public/assets/img/texture-rock.jpg +0 -0
  187. package/public/assets/img/texture-sand-black.jpg +0 -0
  188. package/public/assets/img/texture-sand.jpg +0 -0
  189. package/public/assets/img/texture-silk-black.jpg +0 -0
  190. package/public/assets/img/texture-silk.jpg +0 -0
  191. package/public/assets/topojson/france-departments.json +1 -0
  192. package/public/assets/topojson/paris-arrondissements.json +1 -0
  193. package/public/assets/topojson/world-countries-sans-antarctica.json +1 -0
  194. package/public/favicon-16x16.png +0 -0
  195. package/public/favicon-32x32.png +0 -0
  196. package/public/favicon.ico +0 -0
  197. package/public/site.webmanifest +1 -0
  198. package/stories/assets/code-brackets.svg +1 -0
  199. package/stories/assets/colors.svg +1 -0
  200. package/stories/assets/comments.svg +1 -0
  201. package/stories/assets/direction.svg +1 -0
  202. package/stories/assets/flow.svg +1 -0
  203. package/stories/assets/plugin.svg +1 -0
  204. package/stories/assets/repo.svg +1 -0
  205. package/stories/assets/stackalt.svg +1 -0
  206. package/stories/getting-started/about-icij.mdx +14 -0
  207. package/stories/getting-started/custom-bootstrap.mdx +23 -0
  208. package/stories/getting-started/installation-guide.mdx +62 -0
  209. package/stories/getting-started/internationalization.mdx +63 -0
  210. package/stories/murmur/components/AccordionStep.stories.ts +33 -0
  211. package/stories/murmur/components/AccordionWrapper.stories.ts +69 -0
  212. package/stories/murmur/components/ActiveTextTruncate.stories.ts +32 -0
  213. package/stories/murmur/components/AdvancedLinkForm.stories.ts +77 -0
  214. package/stories/murmur/components/Brand.stories.ts +30 -0
  215. package/stories/murmur/components/BrandExpansion.stories.ts +41 -0
  216. package/stories/murmur/components/ConfirmButton.stories.ts +40 -0
  217. package/stories/murmur/components/ContentPlaceholder.stories.ts +41 -0
  218. package/stories/murmur/components/CustomPagination.stories.ts +42 -0
  219. package/stories/murmur/components/DigitsInput.stories.ts +29 -0
  220. package/stories/murmur/components/DonateForm.stories.ts +29 -0
  221. package/stories/murmur/components/EmbedForm.stories.ts +35 -0
  222. package/stories/murmur/components/EmbeddableFooter.stories.ts +59 -0
  223. package/stories/murmur/components/FollowUsPopover.stories.ts +24 -0
  224. package/stories/murmur/components/GenericFooter.stories.ts +27 -0
  225. package/stories/murmur/components/GenericHeader.stories.ts +27 -0
  226. package/stories/murmur/components/HapticCopy.stories.ts +40 -0
  227. package/stories/murmur/components/ImddbHeader.stories.ts +27 -0
  228. package/stories/murmur/components/OrdinalLegend.stories.ts +49 -0
  229. package/stories/murmur/components/RangePicker.stories.ts +98 -0
  230. package/stories/murmur/components/ResponsiveIframe.stories.ts +24 -0
  231. package/stories/murmur/components/ScaleLegend.stories.ts +65 -0
  232. package/stories/murmur/components/SecretInput.stories.ts +60 -0
  233. package/stories/murmur/components/SelectableDropdown.stories.ts +143 -0
  234. package/stories/murmur/components/SharingOptions.stories.ts +32 -0
  235. package/stories/murmur/components/SharingOptionsLink.stories.ts +53 -0
  236. package/stories/murmur/components/SignUpForm.stories.ts +51 -0
  237. package/stories/murmur/components/SlideUpDown.stories.ts +32 -0
  238. package/stories/murmur/components/TexturedDeck.stories.ts +83 -0
  239. package/stories/murmur/components/TinyPagination.stories.ts +65 -0
  240. package/stories/murmur/datavisualisations/BarChart.stories.ts +54 -0
  241. package/stories/murmur/datavisualisations/ColumnChart.stories.ts +88 -0
  242. package/stories/murmur/datavisualisations/LineChart.stories.ts +139 -0
  243. package/stories/murmur/datavisualisations/StackedBarChart.stories.ts +199 -0
  244. package/stories/murmur/datavisualisations/StackedColumnChart.stories.ts +136 -0
  245. package/stories/murmur/decorators.ts +108 -0
  246. package/stories/murmur/maps/ChoroplethMap.stories.ts +440 -0
  247. package/stories/murmur/maps/ChoroplethMapAnnotation.stories.ts +26 -0
  248. package/stories/murmur/maps/SymbolMap.stories.ts +24 -0
  249. package/stories/murmur/utils.ts +7 -0
  250. package/tests/unit/components/AccordionStep.spec.ts +157 -0
  251. package/tests/unit/components/AccordionWrapper.spec.ts +57 -0
  252. package/tests/unit/components/ActiveTextTruncate.spec.js +30 -0
  253. package/tests/unit/components/AdvancedLinkForm.spec.js +124 -0
  254. package/tests/unit/components/Brand.spec.js +50 -0
  255. package/tests/unit/components/ContentPlaceholder.spec.js +29 -0
  256. package/tests/unit/components/CustomPagination.spec.js +72 -0
  257. package/tests/unit/components/DigitsInput.spec.ts +157 -0
  258. package/tests/unit/components/DonateForm.spec.js +149 -0
  259. package/tests/unit/components/EmbedForm.spec.js +108 -0
  260. package/tests/unit/components/EmbeddableFooter.spec.js +11 -0
  261. package/tests/unit/components/Fa.spec.js +18 -0
  262. package/tests/unit/components/FollowUsPopover.spec.js +29 -0
  263. package/tests/unit/components/GenericFooter.spec.js +29 -0
  264. package/tests/unit/components/GenericHeader.spec.js +104 -0
  265. package/tests/unit/components/HapticCopy.spec.js +123 -0
  266. package/tests/unit/components/ImddbHeader.spec.js +96 -0
  267. package/tests/unit/components/OrdinalLegend.spec.js +120 -0
  268. package/tests/unit/components/RangePicker.spec.ts +87 -0
  269. package/tests/unit/components/ResponsiveIframe.spec.js +20 -0
  270. package/tests/unit/components/ScaleLegend.spec.js +139 -0
  271. package/tests/unit/components/SecretInput.spec.js +81 -0
  272. package/tests/unit/components/SelectableDropdown.spec.js +160 -0
  273. package/tests/unit/components/SharingOptions.spec.js +125 -0
  274. package/tests/unit/components/SharingOptionsLink.spec.js +184 -0
  275. package/tests/unit/components/SignUpForm.spec.js +145 -0
  276. package/tests/unit/components/SlideUpDown.spec.js +59 -0
  277. package/tests/unit/components/TinyPagination.spec.js +46 -0
  278. package/tests/unit/config.spec.js +136 -0
  279. package/tests/unit/datavisualisations/BarChart.spec.js +63 -0
  280. package/tests/unit/datavisualisations/ColumnChart.spec.js +344 -0
  281. package/tests/unit/datavisualisations/LineChart.spec.js +155 -0
  282. package/tests/unit/datavisualisations/StackedBarChart.spec.js +294 -0
  283. package/tests/unit/datavisualisations/StackedColumnChart.spec.js +443 -0
  284. package/tests/unit/i18n.spec.ts +19 -0
  285. package/tests/unit/main.spec.js +82 -0
  286. package/tests/unit/maps/ChoroplethMap.spec.js +214 -0
  287. package/tests/unit/maps/ChoroplethMapAnnotation.spec.ts +186 -0
  288. package/tests/unit/maps/SymbolMap.spec.js +92 -0
  289. package/tests/unit/require.spec.js +22 -0
  290. package/tests/unit/setup.js +13 -0
  291. package/tests/unit/utils/assets.spec.js +61 -0
  292. package/tests/unit/utils/clipboard.spec.js +18 -0
  293. package/tests/unit/utils/iframe-resizer.spec.js +71 -0
  294. package/tsconfig.json +35 -0
  295. package/vite.config.ts +79 -0
  296. package/vitest.config.ts +19 -0
@@ -0,0 +1,160 @@
1
+ Component do draw dead simple stacked bar charts.
2
+
3
+ :::sample-card
4
+ <div class="m-4">
5
+ <h4>
6
+ Medical device companies reported tens of thousands of incidents in 2017
7
+ </h4>
8
+ <p class="text-muted">
9
+ Companies must report when a patient has potentially been hurt or killed by one of their medical devices.
10
+ </p>
11
+ <stacked-bar-chart
12
+ :data="incidentReports"
13
+ class="my-4"
14
+ label-above />
15
+ <p class="text-muted small">
16
+ Note: The companies shown here are 10 of the biggest participants in the medical device industry. Numbers for Becton, Dickinson and Company include adverse events reported by C. R. Bard, which was acquired in 2017. Source: U.S. Food and Drug Administration, ICIJ analysis.
17
+ </p>
18
+ <p class="text-muted">
19
+ Source: ICIJ
20
+ </p>
21
+ </div>
22
+ :::
23
+
24
+ <collapsible-block label="Show the data structure" :json="incidentReports" />
25
+
26
+ Or a more advanced example:
27
+
28
+ :::sample-card
29
+ <div class="m-4">
30
+ <h4>
31
+ How high-budget movies score in the box office?
32
+ </h4>
33
+ <stacked-bar-chart hide-empty-values :data="moviesUrl" label-field="movie" class="my-4" :sort-by="sortKey" :groups="groups" :relative="isRelative">
34
+ <template #header-right>
35
+ <div class="ml-auto d-flex border align-items-center p-0">
36
+ <div class="border-right">
37
+ <b-form-checkbox v-model="isRelative" class="m-2">
38
+ Relative
39
+ </b-form-checkbox>
40
+ </div>
41
+ <label class="m-2 d-flex align-items-center">
42
+ Sort by
43
+ <b-form-select v-model="sortKey" :options="sortKeys" size="sm" class="w-auto ml-2" required></b-form-select>
44
+ </label>
45
+ </div>
46
+ </template>
47
+ </stacked-bar-chart>
48
+ </div>
49
+ :::
50
+
51
+ Or with a fixed height:
52
+
53
+ :::sample-card
54
+ <div class="m-4">
55
+ <h4>Leaks size</h4>
56
+ <p class="text-muted">
57
+ Size of each leak in GB.
58
+ </p>
59
+ <stacked-bar-chart
60
+ class="mb-4"
61
+ hide-legend
62
+ :data="leakSizes"
63
+ :fixed-height="fixedHeight"
64
+ :x-axis-tick-format="humanReadableGb" />
65
+
66
+ <p class="text-muted form-inline align-items-center">
67
+ <span class="ml-auto mr-3 d-inline-flex align-items-center">
68
+ Height:
69
+ <b-form-select class="ml-2" size="sm" v-model="fixedHeight" :options="[200, 300, 400]" />
70
+ </span>
71
+ Source: ICIJ
72
+ </p>
73
+
74
+ </div>
75
+ :::
76
+
77
+ ::: api-table datavisualisations/StackedBarChart.vue :::
78
+
79
+ <script>
80
+ export default {
81
+ data () {
82
+ return {
83
+ fixedHeight: 400,
84
+ incidentReports: [
85
+ {
86
+ "label":"Medtronic PLC",
87
+ "injury":71444,
88
+ "death":1828
89
+ },
90
+ {
91
+ "label":"Abbott Laboratories",
92
+ "injury":40200,
93
+ "death":2816
94
+ },
95
+ {
96
+ "label":"Johnson & Johnson",
97
+ "injury":25863,
98
+ "death":104
99
+ },
100
+ {
101
+ "label":"Boston Scientific",
102
+ "injury":20509,
103
+ "death":725
104
+ },
105
+ {
106
+ "label":"Zimmer Biomet Holdings",
107
+ "injury":15733,
108
+ "death":146
109
+ },
110
+ {
111
+ "label":"Tandem Diabetes Care, Inc.",
112
+ "injury":13658,
113
+ "death":26
114
+ },
115
+ {
116
+ "label":"Stryker",
117
+ "injury":5102,
118
+ "death":90
119
+ },
120
+ {
121
+ "label":"Becton, Dickinson and Company",
122
+ "injury":3569,
123
+ "death":130
124
+ },
125
+ {
126
+ "label":"DexCom, Inc.",
127
+ "injury":1198,
128
+ "death":25
129
+ },
130
+ {
131
+ "label":"Philips",
132
+ "injury":450,
133
+ "death":268
134
+ }
135
+ ],
136
+ moviesUrl: "https://gist.githubusercontent.com/pirhoo/20ce1b795555210c926967a291f8a7ad/raw/13d972b7d2b98b174c33fff38aac2b7d69c85fa7/stacked-bars-movies.json",
137
+ isRelative: true,
138
+ sortKeys: ['movie', 'budget', 'box_office'],
139
+ sortKey: ['movie'],
140
+ groups: ['Budget', 'Box Office'],
141
+ leakSizes: [
142
+ { label: 'Paradise Papers', value: 1.4 * 1e3 },
143
+ { label: 'Panama Papers', value: 2.6 * 1e3 },
144
+ { label: 'Swiss Leaks', value: 3.3 },
145
+ { label: 'LuxLeaks', value: 4 },
146
+ { label: 'Offshore Leaks', value: 260 }
147
+ ]
148
+ }
149
+ },
150
+ methods: {
151
+ humanReadableGb (size) {
152
+ if (size >= 1e3) {
153
+ return `${size/1e3} TB`
154
+ } else {
155
+ return `${size} GB`
156
+ }
157
+ }
158
+ }
159
+ }
160
+ </script>
@@ -0,0 +1,191 @@
1
+ Component do draw dead simple stacked column charts.
2
+
3
+ :::sample-card
4
+ <div class="m-4">
5
+ <h4>
6
+ Breast implant companies buried evidence of injuries for years
7
+ </h4>
8
+ <p class="text-muted">
9
+ Incidents were reported as routine events that did not require public disclosure. After the FDA tightened enforcement of its reporting rules in 2017, reports of injuries soared.
10
+ </p>
11
+ <stacked-column-chart
12
+ :data="incidentReportsUrl"
13
+ :groups="incidentReportsGroups"
14
+ class="my-4"
15
+ y-axis-tick-format=",.0f" />
16
+ <p class="text-muted small">
17
+ Source: U.S. Food and Drug Administration, ICIJ analysis
18
+ </p>
19
+ </div>
20
+ :::
21
+
22
+ Or without direct-labeling:
23
+
24
+ :::sample-card
25
+ <div class="m-4">
26
+ <div class="d-flex align-items-baseline">
27
+ <h4>
28
+ Breast implant companies buried evidence of injuries for years
29
+ </h4>
30
+ <b-form-checkbox class="text-nowrap ml-4" switch v-model="socialMode">
31
+ Social mode
32
+ </b-form-checkbox>
33
+ </div>
34
+ <p class="text-muted">
35
+ Incidents were reported as routine events that did not require public disclosure. After the FDA tightened enforcement of its reporting rules in 2017, reports of injuries soared.
36
+ </p>
37
+ <stacked-column-chart :social-mode="socialMode" no-direct-labeling :data="incidentReportsUrl" y-axis-tick-format=",.0f" class="my-4" />
38
+ <p class="text-muted small">
39
+ Source: U.S. Food and Drug Administration, ICIJ analysis
40
+ </p>
41
+ </div>
42
+ :::
43
+
44
+ <collapsible-block label="Show the data structure">
45
+
46
+ ```json
47
+ [
48
+ {
49
+ "date":2008,
50
+ "death":0,
51
+ "injury":300,
52
+ "malfunction":49
53
+ },
54
+ {
55
+ "date":2009,
56
+ "death":2,
57
+ "injury":138,
58
+ "malfunction":37
59
+ },
60
+ {
61
+ "date":2010,
62
+ "death":3,
63
+ "injury":109,
64
+ "malfunction":44
65
+ },
66
+ {
67
+ "date":2011,
68
+ "death":1,
69
+ "injury":141,
70
+ "malfunction":29
71
+ },
72
+ {
73
+ "date":2012,
74
+ "death":0,
75
+ "injury":175,
76
+ "malfunction":32
77
+ },
78
+ {
79
+ "date":2013,
80
+ "death":4,
81
+ "injury":130,
82
+ "malfunction":40
83
+ },
84
+ {
85
+ "date":2014,
86
+ "death":6,
87
+ "injury":122,
88
+ "malfunction":33
89
+ },
90
+ {
91
+ "date":2015,
92
+ "death":1,
93
+ "injury":163,
94
+ "malfunction":29
95
+ },
96
+ {
97
+ "date":2016,
98
+ "death":5,
99
+ "injury":304,
100
+ "malfunction":28
101
+ },
102
+ {
103
+ "date":2017,
104
+ "death":8,
105
+ "injury":2082,
106
+ "malfunction":48
107
+ },
108
+ {
109
+ "date":2018,
110
+ "death":7,
111
+ "injury":5185,
112
+ "malfunction":86
113
+ }
114
+ ]
115
+ ```
116
+
117
+ </collapsible-block>
118
+
119
+ You can also set the maximum value and use a different field for column's label:
120
+
121
+ :::sample-card
122
+ <div class="m-4">
123
+ <h4>
124
+ ICIJ Staff by office
125
+ </h4>
126
+ <p class="text-muted">As of April 2021. This list is more or less accurate.</p>
127
+ <stacked-column-chart :data="icijStaff" :max-value="10" no-tooltips labelField="city" hide-empty-values class="my-4" />
128
+ </div>
129
+ :::
130
+
131
+ <collapsible-block label="Show the data structure" :json="icijStaff" />
132
+
133
+ It also work with single-value groups:
134
+
135
+ :::sample-card
136
+ <div class="m-4">
137
+ <h4>Leaks size</h4>
138
+ <p class="text-muted">
139
+ Size of ICIJ's leak.
140
+ </p>
141
+ <stacked-column-chart
142
+ :data="leaksSize"
143
+ :y-axis-tick-format="humanReadableGb"
144
+ :max-value="3000"
145
+ label-field="leak"
146
+ class="my-4"
147
+ bar-max-width="50%"
148
+ hide-legend
149
+ no-tooltips />
150
+ <p class="text-muted small">
151
+ Source: ICIJ
152
+ </p>
153
+ </div>
154
+ :::
155
+
156
+ <collapsible-block label="Show the data structure" :json="leaksSize" />
157
+
158
+ ::: api-table datavisualisations/StackedColumnChart.vue :::
159
+
160
+ <script>
161
+ export default {
162
+ data () {
163
+ return {
164
+ socialMode: false,
165
+ incidentReportsUrl: 'https://gist.githubusercontent.com/pirhoo/4055e8d1ee3016805eaf1d2feabdd895/raw/a3d2ba8e9d19fcd9fc659dab50ec075248178238/stacked-colums-incidents.json',
166
+ incidentReportsGroups: ['Deaths', 'Injuries', 'Malfunctions'],
167
+ icijStaff: [
168
+ { "city": "Washington DC", "developers": 1, "journalists": 6, "devops": 1, "finance": 1 },
169
+ { "city": "Paris ", "developers": 5, "journalists": 1, "devops": 0, "finance": 0 },
170
+ { "city": "Madrid ", "developers": 1, "journalists": 0, "devops": 4, "finance": 0 },
171
+ { "city": "New York City", "developers": 0, "journalists": 3, "devops": 0, "finance": 1 },
172
+ { "city": "Syndey", "developers": 0, "journalists": 2, "devops": 0, "finance": 1 },
173
+ ],
174
+ leaksSize: [
175
+ { leak: 'Offshore Leaks (2013)', size: 260 },
176
+ { leak: 'Panama Papers (2016)', size: 2.6 * 1e3 },
177
+ { leak: 'Paradise Papers (2017)', size: 1.4 * 1e3 }
178
+ ]
179
+ }
180
+ },
181
+ methods: {
182
+ humanReadableGb (size) {
183
+ if (size >= 1e3) {
184
+ return `${size/1e3}TB`
185
+ } else {
186
+ return `${size}GB`
187
+ }
188
+ }
189
+ }
190
+ }
191
+ </script>
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: About ICIJ
3
+ order: 30
4
+ ---
5
+
6
+ ICIJ is a [unique organization](https://www.icij.org/about/icijs-story/).
7
+ A U.S.-based nonprofit, we are both **a small, resourceful newsroom** with our
8
+ own reporting team, as well as a **global network of reporters and media
9
+ organizations** who work together to investigate the most important stories in the world.
10
+
11
+ <a class="btn btn-primary text-white text-uppercase fw-bold" target="_blank" href="https://www.icij.org/about/">
12
+ Read more about ICIJ
13
+ </a>
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Customize Boostrap
3
+ description: Use pre-configured variables to build Boostrap.
4
+ order: 20
5
+ ---
6
+
7
+ This guide comes with a set of pre-configured SCSS variables that can be used in
8
+ conjunction with Boostrap. It is **not mandatory** to uses a custom build of Boostrap
9
+ with these variables. Yet some components might have a better display with this configuration.
10
+
11
+ ```scss
12
+ // You can easily override every variables
13
+ $link-color: #c10448;
14
+
15
+ // Then, simply import the variables before you import Bootstrap sources
16
+ @import '@icij/murmur/lib/styles/variables.scss';
17
+ @import 'node_modules/bootstrap/scss/bootstrap';
18
+ // Optional but recommended: Bootstrap Vue CSS additions
19
+ @import 'node_modules/bootstrap-vue/dist/bootstrap-vue.css';
20
+ ```
21
+
22
+ Here are all the variables defined in <repository-link path="lib/styles/variables.scss">lib/styles/variables.scss</repository-link>:
23
+
24
+ <pre class="bg-dark p-3"><code v-html="rawVariables"></code></pre>
25
+
26
+ <script>
27
+ import rawVariables from '@/styles/variables.scss?highlight=scss'
28
+
29
+ export default {
30
+ data () {
31
+ return {
32
+ rawVariables
33
+ }
34
+ }
35
+ }
36
+ </script>
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: Installation Guide
3
+ description: Murmur is ICIJ's Design System for Bootstrap 4 and Vue.js
4
+ order: 10
5
+ ---
6
+
7
+ The <a href="https://icij.org">International Consortium of Investigative Journalists</a>
8
+ aims to build efficient and innovative tools for the biggest cross-border investigations in the world.
9
+ In order to build stable, consistent and user-friendly webapps, our team
10
+ started to define common components between projects, as well as best practices and
11
+ guidelines.
12
+
13
+ ### Install the package
14
+
15
+ If you are using module bundlers such as Webpack or Rollup, you might need to include the package into your project.
16
+ To get started, use NPM or Yarn to get latest version of **@icij/murmur**.
17
+
18
+ ```bash
19
+ # with NPM:
20
+ npm i @icij/murmur
21
+
22
+ # or with Yarn:
23
+ yarn add @icij/murmur
24
+ ```
25
+ Then, register Murmur as a pluggin in your app entry point:
26
+
27
+ ```js
28
+ import Vue from 'vue'
29
+ import Murmur from '@icij/murmur'
30
+
31
+ Vue.use(Murmur)
32
+ ```
33
+
34
+ And import the Murmur's stylesheet:
35
+
36
+ ```scss
37
+ @import "@icij/murmur";
38
+ ```
39
+
40
+ Now all components will be globally available in your app. Murmur also exposes a
41
+ configuration object to handle common configuration option. To customize the
42
+ default options please refer to the [dedicated page](#/utilities/config).
43
+
44
+ If you need to usage component with images, please make sure to [configure assets](#/utilities/assets) properly so images are available in your final app bundle.
45
+
46
+ ### Individual components
47
+
48
+ An alternative to installing all components with a pluggin is to import only
49
+ a specific component.
50
+
51
+ ```js
52
+ import { EmbedForm } from '@icij/murmur'
53
+
54
+ Vue.component('component-name', {
55
+ components: {
56
+ EmbedForm
57
+ }
58
+ })
59
+ ```
@@ -0,0 +1,74 @@
1
+ ---
2
+ title: Internationalization
3
+ description: Translate your components
4
+ order: 30
5
+ ---
6
+
7
+ ### How it work
8
+
9
+ Murmur can be translated using [vue-i18n](https://github.com/kazupon/vue-i18n).
10
+ By default, we provide a series of locales in English for our components. The
11
+ translation library is installed at a component level. So each component using
12
+ translation received a `i18n` attribute.
13
+
14
+ ### Adding more locales
15
+
16
+ Murmur exposes a static method to add new locales:
17
+
18
+ ```js
19
+ import Murmur from '@icij/murmur'
20
+
21
+ Murmur.setLocaleMessage('fr', {
22
+ "imddb-header": {
23
+ "navbar": {
24
+ "leak": "Contact confidentiel",
25
+ "support": "Soutenez nous",
26
+ "follow": "Suivez l'ICIJ"
27
+ }
28
+ }
29
+ })
30
+ ```
31
+
32
+ Then you can switch to a new language easily:
33
+
34
+ ```js
35
+ Murmur.setLocale('fr')
36
+ ```
37
+
38
+ ### Overiding locales
39
+
40
+ In the very same fashion, you can modify existing locales:
41
+
42
+ ```js
43
+ import Murmur from '@icij/murmur'
44
+
45
+ Murmur.mergeLocaleMessage('en', {
46
+ "imddb-header": {
47
+ "navbar": {
48
+ "leak": "SecureDrop",
49
+ "support": "Buy us a beer 🍺",
50
+ "follow": "Follow ICIJ"
51
+ }
52
+ }
53
+ })
54
+ ```
55
+
56
+ ### Default locales
57
+
58
+ Here are English locales defined in <repository-link path="lib/locales/en.json">lib/locales/en.json</repository-link>:
59
+
60
+ <collapsible-block label="All English locales">
61
+ <pre class="bg-dark p-3 m-0"><code>{{ JSON.stringify(en, null, 2) }}</code></pre>
62
+ </collapsible-block>
63
+
64
+ <script>
65
+ import en from '@/locales/en.json'
66
+
67
+ export default {
68
+ data () {
69
+ return {
70
+ en
71
+ }
72
+ }
73
+ }
74
+ </script>