Skip to content

Commit

Permalink
[docs] add treeshaking selective import
Browse files Browse the repository at this point in the history
  • Loading branch information
pratu16x7 committed Apr 20, 2018
1 parent 8630548 commit 1dbf54d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

and include in your project:
```js
import Chart from "frappe-charts"
import { Chart } from "frappe-charts"
```

* ...or include within your HTML
Expand Down Expand Up @@ -73,7 +73,8 @@ const data = {
]
}

const chart = new Chart("#chart", { // or a DOM element
const chart = new frappe.Chart("#chart", { // or a DOM element,
// new Chart() in case of ES6 module with above usage
title: "My Awesome Chart",
data: data,
type: 'axis-mixed', // or 'bar', 'line', 'scatter', 'pie', 'percentage'
Expand Down
8 changes: 6 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h6 class="margin-vertical-rem">Create a chart</h6>
<pre><code class="hljs html"> &lt!--HTML--&gt;
&lt;div id="chart"&gt;&lt;/div&gt;</code></pre>
<pre><code class="hljs javascript"> // Javascript
let chart = new Chart( "#chart", { // or DOM element
let chart = new frappe.Chart( "#chart", { // or DOM element
data: {
labels: ["12am-3am", "3am-6am", "6am-9am", "9am-12pm",
"12pm-3pm", "3pm-6pm", "6pm-9pm", "9pm-12am"],
Expand Down Expand Up @@ -211,7 +211,7 @@ <h6 class="margin-vertical-rem">
<div class="btn-group export-buttons mt-1 mx-auto" role="group">
<button type="button" class="btn btn-sm btn-secondary export-heatmap">Export ...</button>
</div>
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new Chart("#heatmap", {
<pre><code class="hljs javascript margin-vertical-px"> let heatmap = new frappe.Chart("#heatmap", {
type: 'heatmap',
title: "Monthly Distribution",
data: {
Expand Down Expand Up @@ -316,6 +316,10 @@ <h6 class="margin-vertical-rem">Install</h6>
<pre><code class="hljs javascript"> import { Chart } from "frappe-charts"</code></pre>
<p class="step-explain">... or include it directly in your HTML</p>
<pre><code class="hljs html"> &lt;script src="https://unpkg.com/[email protected]"&gt;&lt;/script&gt;</code></pre>
<p class="step-explain">Use as:</p>
<pre><code class="hljs javascript"> new Chart(); // ES6 module
// or
new frappe.Chart(); // Browser</code></pre>

</div>
</div>
Expand Down

0 comments on commit 1dbf54d

Please sign in to comment.