vvplot 0.4.3 → 0.4.5

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 CHANGED
@@ -28,19 +28,24 @@ const data = [{ x: 1, y: 2 }, { x: 2, y: 3 }, { x: 3, y: 5 }]
28
28
  <link rel="stylesheet" href="https://unpkg.com/vvplot@latest/dist/style.css">
29
29
  </head>
30
30
  <body>
31
- <div id="plot"></div>
31
+ <div id="plot" style="display:flex">
32
+ <v-v-plot :data="data" :width="600" :height="400" legend-teleport="#legend">
33
+ <v-v-geom-point :x="d => d.Weight_in_lbs" :y="d => d.Miles_per_Gallon"
34
+ :color="d => d.Origin"></v-v-geom-point>
35
+ </v-v-plot>
36
+ <div id="legend"></div>
37
+ </div>
32
38
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
33
39
  <script src="https://unpkg.com/vvplot@latest/dist/vvplot.global.js"></script>
34
40
  <script>
35
41
  const { createApp, ref } = Vue
36
42
  const { components } = VVPlot
37
- const data = [{ x: 1, y: 2 }, { x: 2, y: 3 }, { x: 3, y: 5 }]
38
- let template = `<VVPlot :data="data" :width="600" :height="400">
39
- <VVGeomPoint :x="d => d.x" :y="d => d.y" />
40
- </VVPlot>`
43
+ const data = ref([])
44
+ fetch("https://cdn.jsdelivr.net/npm/vega-datasets@latest/data/cars.json")
45
+ .then(response => response.json())
46
+ .then(json => data.value = json)
41
47
  let app = createApp({
42
- setup() { return { data } },
43
- template
48
+ setup() { return { data } }
44
49
  })
45
50
  for (let c in components) {
46
51
  app.component(c, components[c])
package/dist/style.css CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  .vvplot-legend {
2
3
  display: flex;
3
4
  flex-direction: column;