Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the “raw data” button optional #92

Merged
merged 3 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ For details on how each kind of chart is rendered, take a look at [`charts.js`](

| option | values | description |
|---|---|---|
| `series ` | array of strings | only include these data series and drop all others (referenced by TSV table headings) |
| `visibleSeries ` | array of strings | only show the listed data series and hide all others initially (referenced by TSV table headings) |
| `sliceData ` | array `[t0, t1]` | slice the data from the TSV file as if `data.slice(t0, t1)` was called |
| `aggregate ` | weekly | if set to `weekly`, aggregate the data by week by computing the sum of the values within each week |
| `series ` | array of strings | only include these data series and drop all others (referenced by TSV table headings) |
| `visibleSeries ` | array of strings | only show the listed data series and hide all others initially (referenced by TSV table headings) |
| `sliceData ` | array `[t0, t1]` | slice the data from the TSV file as if `data.slice(t0, t1)` was called |
| `aggregate ` | weekly | if set to `weekly`, aggregate the data by week by computing the sum of the values within each week |
| `showRawDataLink` | `true`, `false` | show the link to download the chart’s raw data (default: `true`) |

##### List Charts

Expand Down
10 changes: 5 additions & 5 deletions docs/assets/css/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ a
width: 100%;
}

.row h3
{
margin: 0;
}

.info-box
{
background-color: #f5f5f5;
Expand Down Expand Up @@ -643,11 +648,6 @@ a
margin-bottom: 1rem;
}

.action-bar h3
{
margin: 0;
}

button,
a.button
{
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ $(window).bind('load', function()
const infoBoxes = $(chartPlaceholder).find('.info-box');

// Put a bar with the title and additional actions before the chart container
if ($(charts.first()).attr('data-url'))
if (readConfig($(charts.first()), 'showRawDataLink') != false && $(charts.first()).attr('data-url'))
{
titles.insertBefore(chartPlaceholder).wrapAll(
'<div class="row action-bar"><div class="col-main"></div></div>');
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h3>Collaboration Across Organizations</h3>
height="1000"
data-url="{{ site.dataURL }}/org-collaboration.tsv"
data-type="chord"
data-config='{"showRawDataLink": false}'
></svg>
<div class="info-box">
<p>
Expand Down