Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Jan 15, 2020
1 parent 0857bd5 commit 52a48a8
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=description content="Vue component to draw bar charts using d3 "><title>vue-d3-barchart</title><link href="https://fonts.googleapis.com/css?family=Asap" rel=stylesheet><link href="https://fonts.googleapis.com/css?family=Belgrano" rel=stylesheet><link href=/vue-d3-barchart/css/app.c5195807.css rel=preload as=style><link href=/vue-d3-barchart/js/app.bf3e13d0.js rel=preload as=script><link href=/vue-d3-barchart/js/chunk-vendors.f317d73f.js rel=preload as=script><link href=/vue-d3-barchart/css/app.c5195807.css rel=stylesheet></head><body><div id=app></div><script src=/vue-d3-barchart/js/chunk-vendors.f317d73f.js></script><script src=/vue-d3-barchart/js/app.bf3e13d0.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=description content="Vue component to draw bar charts using d3 "><title>vue-d3-barchart</title><link href="https://fonts.googleapis.com/css?family=Asap" rel=stylesheet><link href="https://fonts.googleapis.com/css?family=Belgrano" rel=stylesheet><link href=/vue-d3-barchart/css/app.c5195807.css rel=preload as=style><link href=/vue-d3-barchart/js/app.3c0fed29.js rel=preload as=script><link href=/vue-d3-barchart/js/chunk-vendors.95bfe8ac.js rel=preload as=script><link href=/vue-d3-barchart/css/app.c5195807.css rel=stylesheet></head><body><div id=app></div><script src=/vue-d3-barchart/js/chunk-vendors.95bfe8ac.js></script><script src=/vue-d3-barchart/js/app.3c0fed29.js></script></body></html>
2 changes: 2 additions & 0 deletions example/js/app.3c0fed29.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/js/app.3c0fed29.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions example/js/app.bf3e13d0.js

This file was deleted.

1 change: 0 additions & 1 deletion example/js/app.bf3e13d0.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/js/chunk-vendors.95bfe8ac.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion example/js/chunk-vendors.f317d73f.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions src/example/BarChartExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import curve from './data/curve'
import points from './data/points'
import curvePoints from './data/curvePoints'
import curveColors from './data/curveColors'
import curveRect from './data/curveRect'
import bars2 from './data/bars2'
export default {
name: 'bar-chart-example',
Expand All @@ -25,7 +25,7 @@ export default {
data () {
return {
copyIcon,
charts: { bars, curve, points, curvePoints, curveColors, curveRect }
charts: { bars, curve, points, curvePoints, curveColors, bars2 }
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions src/example/data/bars2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { createExampleData, randomValue } from './lib'
import colors from '../../colors.json'
const title = 'Bars'
const chartData = [2, 7, 10, 11, 12, 14, 15, 21, 30, 31, 39, 50].map(x => {
let y = randomValue(1, 30)
return { x, y }
})
const options = {
marks: false,
axis: {
valuesY: true,
linesY: true,
linesX: true,
valuesX: true
},
margin: 0,
domain: {
min: 0
},
getX: (d) => d.x,
getY: (d) => d.y,
colors: [
colors.red, colors.blue
]
}
export default createExampleData({ title, options, chartData })
2 changes: 1 addition & 1 deletion src/example/data/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const createExampleData = ({ title, chartData, options, controls }) => {
title = title || 'example'
chartData = chartData || randomData()
options = options || defaultOptions
options = Object.assign(options, { getY: (d) => d.v })
options = (!options.getY) ? Object.assign(options, { getY: (d) => d.v }) : options
return { title, chartData, options, controls }
}

0 comments on commit 52a48a8

Please sign in to comment.