Skip to content

Commit

Permalink
d3 as dependency, not bundled in
Browse files Browse the repository at this point in the history
  • Loading branch information
wwsalmon committed May 3, 2020
1 parent 38680ab commit 70ef8b8
Show file tree
Hide file tree
Showing 16 changed files with 472 additions and 174 deletions.
3 changes: 2 additions & 1 deletion 2019/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' type='text/css' href='../css/style-2019.min.css'>
<script src="../dist/sota.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.min.js"></script>
<script src="../dist/sota.min.js"></script>
<title>State of the Academy 2019</title>
</head>
<body>
Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@ Charting library for *The Phillipian*'s [annual State of the Academy survey proj

# Installation

Using browser/plain JS: download `dist/sota.min.js` (eventually this will be in releases...) and include it in your project:
## Using browser/plain JS:

`<script src="PATH/TO/sota.min.js"></script>`
1. Download or use a cdn to include d3 in your project before sota.js:

Using npm (not recommended for now, I'm working on it):
<script src="PATH/TO/d3.min.v5.js"></script>

`npm i sota.js`
2. Download `dist/sota.min.js` (eventually this will be in releases...) and include it in your project:

# Usage
<script src="PATH/TO/sota.min.js"></script>

3. In your app or index js, you can now access the `sota` object with functions like `sota.barChart()`.

## Using npm:

Run:

npm i sota.js

If npm:
d3 is a dependency, so you don't have to worry about it separately.

`import sota from "sota.js"`
Then, in your app or index js:

import sota from "sota.js"

And now you have access to the `sota` object with functions like `sota.barChart()`.

# Usage

Then (or just by including the script in browser/plain JS) you have access to the `sota` object and can call functions like `sota.barChart()`. Detailed instructions on component parameters and usage to come.
Usage documentation to come.
2 changes: 1 addition & 1 deletion dist/sota.min.js

Large diffs are not rendered by default.

297 changes: 148 additions & 149 deletions dist/sota.node.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/components/barChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig, toPercentage } from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/boilerplate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig } from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/columnChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import {sotaConfig, toPercentage} from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/customBarChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig } from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/groupedBarChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig, toPercentage } from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/lineGraph.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig, toPercentage } from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/pieChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import {sotaConfig, toPercentage} from '../helper.js';

export default function ({
Expand Down
2 changes: 1 addition & 1 deletion js/components/stackedBarChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../d3.v5.min.js';
import * as d3 from "d3";
import { sotaConfig, hideIfOOB, toPercentage } from '../helper.js';

export default function ({
Expand Down
2 changes: 0 additions & 2 deletions js/d3.v5.min.js

This file was deleted.

Loading

0 comments on commit 70ef8b8

Please sign in to comment.