Skip to content

Commit

Permalink
Added script to copy out BBEA tool to own repository for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
amb26 committed Oct 9, 2024
1 parent 3d806f8 commit 432cbf2
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 12 deletions.
5 changes: 4 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ const buildIndex = {
],
// Full source for environments with strong focus on biodiversity info
newSource: [
"src/client/css/mapbox-gl-draw.css",
"node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js",
"src/client/css/mapbox-gl-draw.css", // has our own overrides
"node_modules/papaparse/papaparse.min.js",
"node_modules/pretty-checkbox/dist/pretty-checkbox.min.css",
"node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js",
"node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css",
"src/lib/jquery-ui-widgets-tabs.js",
"src/lib/point-in-polygon.js",
"src/geom/geoJSON.js",
"src/utils/utils.js",
"src/client/js/new/filters.js",
"src/client/js/new/polygon-draw.js",
Expand Down
6 changes: 6 additions & 0 deletions docs/css/imerss-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@
cursor: pointer;
width: 20px;
height: 20px;
border-radius: 6px;
}

.imerss-filter-clear:hover {
/** TODO consolidate these, e.g. imerss-reset-filter */
background: #d0d7de33;
}

.imerss-filter-clear.imerss-hidden {
Expand Down
6 changes: 6 additions & 0 deletions docs/css/imerss-viz-all.css
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,12 @@ a.ui-button:active,
cursor: pointer;
width: 20px;
height: 20px;
border-radius: 6px;
}

.imerss-filter-clear:hover {
/** TODO consolidate these, e.g. imerss-reset-filter */
background: #d0d7de33;
}

.imerss-filter-clear.imerss-hidden {
Expand Down
6 changes: 6 additions & 0 deletions docs/css/imerss-viz-lib.css
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,12 @@ a.ui-button:active,
cursor: pointer;
width: 20px;
height: 20px;
border-radius: 6px;
}

.imerss-filter-clear:hover {
/** TODO consolidate these, e.g. imerss-reset-filter */
background: #d0d7de33;
}

.imerss-filter-clear.imerss-hidden {
Expand Down
3 changes: 0 additions & 3 deletions docs/indexBeasOBA.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@

<title>Oregon Bee Atlas Plant-Pollinator Interactions</title>

<link rel="stylesheet" href="css/imerss-viz-lib.css" />
<!-- Looks like this comes from here - use CDN since it refers to relative fonts
https://github.com/Templarian/MaterialDesign-Webfont/releases/tag/v2.0.46 -->
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css">

<script src="https://unpkg.com/[email protected]/papaparse.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/d3.min.js"></script>
<script src="https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.js"></script>
<script src="js/vizjs.js"></script>
<script src="js/bipartitePP.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion docs/js/imerss-viz-new-core.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions docs/js/imerss-viz-new.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/imerss-viz-new.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/buildSource/indexBeasOBA.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@

<title>Oregon Bee Atlas Plant-Pollinator Interactions</title>

<link rel="stylesheet" href="css/imerss-viz-lib.css" />
<!-- Looks like this comes from here - use CDN since it refers to relative fonts
https://github.com/Templarian/MaterialDesign-Webfont/releases/tag/v2.0.46 -->
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css">

<script src="https://unpkg.com/[email protected]/papaparse.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/d3.min.js"></script>
<script src="https://unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.js"></script>
<script src="js/vizjs.js"></script>
<script src="js/bipartitePP.js"></script>

Expand Down
6 changes: 6 additions & 0 deletions src/client/css/imerss-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@
cursor: pointer;
width: 20px;
height: 20px;
border-radius: 6px;
}

.imerss-filter-clear:hover {
/** TODO consolidate these, e.g. imerss-reset-filter */
background: #d0d7de33;
}

.imerss-filter-clear.imerss-hidden {
Expand Down
2 changes: 1 addition & 1 deletion src/client/js/new/polygon-draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You may obtain a copy of the ECL 2.0 License and BSD License at
https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
*/

/* global MapboxDraw */
/* global MapboxDraw, hortis */

"use strict";

Expand Down
68 changes: 68 additions & 0 deletions src/copyBeasOut.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* eslint-env node */

"use strict";

const fs = require("fs-extra"),
path = require("path"),
fluid = require("infusion");

require("../index.js");

const config = {
target: "%b-team/docs/",
copyJobs: [
{
source: "%imerss-bioinfo/docs/indexBeasOBA.html",
target: "%b-team/docs/index.html"
},
"%imerss-bioinfo/docs/js/vizjs.js",
"%imerss-bioinfo/docs/js/bipartitePP.js",

"%imerss-bioinfo/docs/css/imerss-viz-lib.css",
"%imerss-bioinfo/docs/css/imerss-viz-new-core.css",
"%imerss-bioinfo/docs/css/imerss-viz-new.css",
"%imerss-bioinfo/docs/css/imerss-bbea.css",

"%imerss-bioinfo/docs/js/jquery.js",
"%imerss-bioinfo/docs/js/imerss-viz-lib.js",
"%imerss-bioinfo/docs/js/imerss-viz-new-core.js",
"%imerss-bioinfo/docs/js/imerss-viz-new.js",
"%imerss-bioinfo/docs/js/imerss-bbea.js",

"%imerss-bioinfo/docs/img/x-circle-close.svg",

"%imerss-bioinfo/docs/data/b-team/plant-pollinators-OBA-2-assigned-subset-labels.csv",
"%imerss-bioinfo/docs/data/b-team/plant-pollinators-OBA-2-assigned-taxa.csv",
"%imerss-bioinfo/docs/data/b-team/us-eco-l3-regions.csv"
]
};

console.log(fluid.module.resolvePath("%imerss-bioinfo/"));

const b_team = path.join(fluid.module.resolvePath("%imerss-bioinfo/"), "../b-team/");


fluid.module.register("b-team", b_team, require);

const copyOut = function () {
const defTarget = fluid.module.resolvePath(config.target);
const computeTarget = function (source) {
const dp = source.indexOf("/docs/");
const stem = source.substring(dp + "/docs/".length);
return path.join(defTarget, stem);
};

config.copyJobs.forEach(oneJob => {
const job = typeof(oneJob) === "string" ? {source: oneJob} : oneJob;
const source = fluid.module.resolvePath(job.source);
const target = job.target ? fluid.module.resolvePath(job.target) : computeTarget(job.source);

fs.ensureDirSync(path.dirname(target));
fs.copySync(source, target);

console.log("Copied ", source, " to ", target);
});

};

copyOut();

0 comments on commit 432cbf2

Please sign in to comment.