Skip to content

Commit

Permalink
example pages link to each other
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Apr 28, 2020
1 parent e4d8d1e commit 64716df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ module.exports = function (grunt) {
title: 'Index of dc.js examples',
heading: 'Examples of using dc.js',
description: 'An attempt to present a simple example of each chart type.',
also: ['transitions', 'resizing', 'zoom'],
sourceLink: 'https://github.com/dc-js/dc.js/tree/develop/<%= conf.websrc %>/examples'
},
files: [
Expand All @@ -304,6 +305,7 @@ module.exports = function (grunt) {
heading: 'Eyeball tests for dc.js transitions',
description: 'Transitions can only be tested by eye. ' +
'These pages automate the transitions so they can be visually verified.',
also: ['examples', 'resizing', 'zoom'],
sourceLink: 'https://github.com/dc-js/dc.js/tree/develop/<%= conf.websrc %>/transitions'
},
files: [
Expand All @@ -321,6 +323,7 @@ module.exports = function (grunt) {
'For the examples with a single chart taking up the entire window, you can add <code>?resize=viewbox</code> ' +
'to the URL to test resizing the chart using the ' +
'<a href="http://dc-js.github.io/dc.js/docs/html/dc.baseMixin.html#useViewBoxResizing__anchor">useViewBoxResizing</a> strategy.',
also: ['examples', 'transitions', 'zoom'],
sourceLink: 'https://github.com/dc-js/dc.js/tree/develop/<%= conf.websrc %>/resizing'
},
files: [
Expand All @@ -335,6 +338,7 @@ module.exports = function (grunt) {
heading: 'Interactive test for dc.js chart zoom',
description: 'It\'s hard to conceive of a way to test zoom except by trying it. ' +
'So this is a substitute for automated tests in this area',
also: ['examples', 'transitions', 'resizing'],
sourceLink: 'https://github.com/dc-js/dc.js/tree/develop/<%= conf.websrc %>/zoom'
},
files: [
Expand Down
2 changes: 2 additions & 0 deletions grunt/format-file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ module.exports = function (grunt) {
}
rows.push(` <tr>\n${cols.join('\n')}\n </tr>`);
}
const alsoSee = opts.also ? `<p>Also see ${opts.also.map(cat => `<a href="../${cat}/">${cat}</a>`).join(' &ndash; ')}.</p>`: '';
const body = `<table class="table">\n${rows.join('\n')}\n</table>`;
return [
`<html><head><title>${opts.title}</title>`,
'<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"></head>',
'<body><div class="container">',
`<h2>${opts.heading}</h2>`,
`<p>${opts.description}</p>`,
alsoSee,
'<p>Contributions <a href="https://github.com/dc-js/dc.js/blob/master/CONTRIBUTING.md">welcome</a>.',
`Source <a href="${opts.sourceLink}">`,
'here</a>.</p>',
Expand Down

0 comments on commit 64716df

Please sign in to comment.