@@ -93,6 +93,13 @@ def file_links(release):
9393<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/dygraphs@%(version)s/dist/dygraph.min.js"></script>
9494</pre>
9595
96+ <p>Note: if you wish to use jsDelivr’s ESM feature, you need to replace
97+ <tt>import * as dygraphs from 'https://esm.run/dygraphs';</tt>, which is the string they give you, with
98+ <tt>import Dygraph from 'https://esm.run/dygraphs';</tt>, i.e. replace
99+ the <tt>* as dygraphs</tt> part with <tt>Dygraph</tt> so to have that
100+ symbol available.<br />You’ll <em>also</em> still need to include the
101+ CSS separately.</p>
102+
96103<p>There's a hosted version of dygraphs on <a
97104 href="https://cdnjs.com/libraries/dygraph">cdnjs.com</a>
98105 (note that it may take some time to update to new releases):</p>
@@ -104,6 +111,7 @@ def file_links(release):
104111<p class="nomarginbottom">But note that use of CDNs violates the EU-GDPR.</p>
105112
106113</fieldset>
114+ <fieldset><legend>Install from binary packages</legend>
107115
108116<p>Besides the tarballs
109117 (see above) you can also install dygraphs locally into your project
@@ -113,8 +121,27 @@ def file_links(release):
113121 # dygraphs is now in node_modules/dygraphs/dist/dygraph.{css,js} for
114122 # the browser, and node_modules/dygraphs/index{,.es5}.js for nodejs</pre>
115123
124+ <p>There’s also a Debian package available:</p>
125+
126+ <pre>$ sudo apt-get install libjs-dygraphs
127+ # dygraphs is now in /usr/share/javascript/dygraphs/dygraph.{css,js}
128+
129+ # To access the documentation locally, run in a terminal:
130+ $ cd /usr/share/doc/libjs-dygraphs/site && python3 -m http.server
131+ # Navigate to http://127.0.0.1:8000/ while this is running.
132+
133+ # When a webserver is running, do:
134+ $ sudo apt-get install javascript-common
135+ $ sudo a2enconf javascript-common.conf && sudo service apache2 reload
136+ # dygraphs is now also available at /javascript/dygraphs/dygraph.{css,js}
137+ # so it can be used from webpages served by the system in question</pre>
138+
139+ </fieldset>
140+
116141<p>Most distributions include a source map to facilitate debugging.</p>
117142
143+ <fieldset><legend>Build from source</legend>
144+
118145<p>To generate your own minified JS, install the prerequisites…</p><ul>
119146<li><tt>mksh</tt></li>
120147<li><tt>pax</tt></li>
@@ -130,6 +157,11 @@ def file_links(release):
130157<p>This will create a <tt>dygraph.min.css</tt> and a <tt>dygraph.min.js</tt>
131158 file in the <code>dist</code> directory.</p>
132159
160+ <p class="nomarginbottom">Building and testing the full distribution
161+ is slightly more intricate.</p>
162+
163+ </fieldset>
164+
133165<p>You may also download files for previously-released versions:</p>
134166
135167<ul>
0 commit comments