How to use the @mathigon/boost.loadScript function in @mathigon/boost

To help you get started, we’ve selected a few @mathigon/boost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathigon / textbooks / content / shared / components / webgl.ts View on Github external
function loadTHREE() {
  if (!threePromise) threePromise = loadScript(url);
  return threePromise;
}
github mathigon / textbooks / content / circles / components / d3-geo.ts View on Github external
export async function loadD3() {
  const load1 = loadScript('/resources/shared/vendor/d3.v4.min.js');
  const load2 = loadScript('/resources/shared/vendor/d3-geo-projection.v2.min.js');
  const load3 = loadScript('/resources/shared/vendor/topojson.v1.min.js');

  await Promise.all([load1, load2, load3]);
  const text = await fetch('/resources/circles/images/world-110m.json');
  const world = await text.json() as any;
  return {d3: d3, topojson: topojson, world};
}
github mathigon / textbooks / content / circles / components / d3-geo.ts View on Github external
export async function loadD3() {
  const load1 = loadScript('/resources/shared/vendor/d3.v4.min.js');
  const load2 = loadScript('/resources/shared/vendor/d3-geo-projection.v2.min.js');
  const load3 = loadScript('/resources/shared/vendor/topojson.v1.min.js');

  await Promise.all([load1, load2, load3]);
  const text = await fetch('/resources/circles/images/world-110m.json');
  const world = await text.json() as any;
  return {d3: d3, topojson: topojson, world};
}
github mathigon / textbooks / content / circles / components / d3-geo.ts View on Github external
export async function loadD3() {
  const load1 = loadScript('/resources/shared/vendor/d3.v4.min.js');
  const load2 = loadScript('/resources/shared/vendor/d3-geo-projection.v2.min.js');
  const load3 = loadScript('/resources/shared/vendor/topojson.v1.min.js');

  await Promise.all([load1, load2, load3]);
  const text = await fetch('/resources/circles/images/world-110m.json');
  const world = await text.json() as any;
  return {d3: d3, topojson: topojson, world};
}