Skip to content

Commit

Permalink
update bar example, rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Delany committed Nov 15, 2017
1 parent 74afdeb commit 0a6414a
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 45 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
</div>

<div class="container-fluid" id="container">Loading...</div>
<script type="text/javascript" src="bundle.250163bd191e432b1eb2.js"></script></body>
<script type="text/javascript" src="bundle.d5a14f31ef32e35ddf47.js"></script></body>
</html>
13 changes: 12 additions & 1 deletion docs/src/docs/Bar/examples/Bar.js.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const BarExample = (props) => {
return <div>insert example here</div>;
return <svg width={100} height={100}>
<Bar
scale={{
x: d3.scalePoint().domain(['a', 'b', 'c']).range([0, 100]),
y: d3.scaleLinear().domain([0, 1]).range([100, 0]),
}}
xValue={'b'}
yValue={0}
yEndValue={0.75}
thickness={15}
/>
</svg>;
};

ReactDOM.render(<BarExample />, mountNode);
39 changes: 30 additions & 9 deletions docs/src/docs/Bar/propDocs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Bar is a low-level component to be used in XYPlot-type charts (namely BarChart)\nIt is specified in terms of a range (min & max) of values on one axis (the bar's long axis)\nand a single value on the other axis.\nPassing props `xValue`, `xEndValue` and `yValue` specifies a horizontal bar,\ncentered on `yValue` and spanning from `xValue` to `xEndValue`;\npassing props `xValue`, `yValue`, and `yEndValue' specifies a vertical bar.",
"description": "Bar is a low-level component to be used in XYPlot-type charts (namely BarChart).\nIt is specified in terms of a range (min & max) of values on one axis (the bar's long axis)\nand a single value on the other axis.\nPassing props `xValue`, `xEndValue` and `yValue` specifies a horizontal bar,\ncentered on `yValue` and spanning from `xValue` to `xEndValue`;\npassing props `xValue`, `yValue`, and `yEndValue' specifies a vertical bar.",
"methods": [],
"props": {
"scale": {
Expand All @@ -17,14 +17,14 @@
}
},
"required": false,
"description": ""
"description": "D3 scales for the X and Y axes of the chart, in {x, y} object format."
},
"xValue": {
"type": {
"name": "any"
},
"required": false,
"description": "",
"description": "For a vertical bar, xValue represents the X data value on which the bar is centered.\nFor a horizontal bar, represents the *starting* X data value of the bar, ie. the minimum of the range it spans",
"defaultValue": {
"value": "0",
"computed": false
Expand All @@ -35,7 +35,7 @@
"name": "any"
},
"required": false,
"description": "",
"description": "For a horizontal bar, yValue represents the Y data value on which the bar is centered.\nFor a vertical bar, represents the *starting* Y data value of the bar, ie. the minimum of the range it spans",
"defaultValue": {
"value": "0",
"computed": false
Expand All @@ -46,21 +46,21 @@
"name": "any"
},
"required": false,
"description": ""
"description": "For a horizontal bar, represents the *ending* X data value of the bar, ie. the maximum of the range it spans.\nShould be undefined if the bar is vertical."
},
"yEndValue": {
"type": {
"name": "any"
},
"required": false,
"description": ""
"description": "For a vertical bar, represents the *ending* Y data value of the bar, ie. the maximum of the range it spans.\nShould be undefined if the bar is horizontal."
},
"thickness": {
"type": {
"name": "number"
},
"required": false,
"description": "",
"description": "The thickness of the bar, in pixels. (width of vertical bar, or height of horizontal bar)",
"defaultValue": {
"value": "8",
"computed": false
Expand All @@ -71,7 +71,7 @@
"name": "string"
},
"required": false,
"description": "",
"description": "Class name(s) to be included on the bar's <rect> element",
"defaultValue": {
"value": "''",
"computed": false
Expand All @@ -82,11 +82,32 @@
"name": "object"
},
"required": false,
"description": "",
"description": "Inline style object to be included on the bar's <rect> element",
"defaultValue": {
"value": "{}",
"computed": false
}
},
"onMouseMove": {
"type": {
"name": "func"
},
"required": false,
"description": "onMouseMove event handler callback, called when user's mouse moves within the bar."
},
"onMouseEnter": {
"type": {
"name": "func"
},
"required": false,
"description": "onMouseEnter event handler callback, called when user's mouse enters the bar."
},
"onMouseLeave": {
"type": {
"name": "func"
},
"required": false,
"description": "onMouseLeave event handler callback, called when user's mouse leaves the bar."
}
}
}
16 changes: 8 additions & 8 deletions docs/src/docs/XYPlot/propDocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"name": "number"
},
"required": false,
"description": "",
"description": "(outer) width of the chart (SVG element).",
"defaultValue": {
"value": "400",
"computed": false
Expand All @@ -59,34 +59,34 @@
"name": "number"
},
"required": false,
"description": "",
"description": "(outer) width of the chart (SVG element).",
"defaultValue": {
"value": "250",
"computed": false
}
},
"scale": {
"domain": {
"type": {
"name": "object"
},
"required": false,
"description": ""
"description": "The X and/or Y domains of the data in {x: [...], y: [...]} format.\nFor numerical scales, this is represented as [min, max] of the data;\nfor ordinal/categorical scales it is an array of known values ie. ['a', 'b', 'c'].\nAutomatically determined from data if not passed."
},
"scaleType": {
"margin": {
"type": {
"name": "object"
},
"required": false,
"description": ""
},
"domain": {
"scale": {
"type": {
"name": "object"
},
"required": false,
"description": ""
"description": "d3 scales for the X and Y axes of the chart, in {x, y} object format.\n(optional, normally determined automatically by XYPlot)"
},
"margin": {
"scaleType": {
"type": {
"name": "object"
},
Expand Down
44 changes: 42 additions & 2 deletions lib/Bar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0a6414a

Please sign in to comment.