Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
eireland committed Feb 27, 2024
2 parents 9507a7f + 6f553ba commit ef34fac
Show file tree
Hide file tree
Showing 57 changed files with 2,161 additions and 4,969 deletions.
2 changes: 1 addition & 1 deletion Common/js/build-include.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
window.codapPluginConfig = {
buildNumber: "0062"
buildNumber: "0063"
}
33 changes: 31 additions & 2 deletions Importer/modules/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,35 @@
"DG.plugin.Transformers.title": "Transformers",
"DG.plugin.Transformers.description": "Transform datasets with a collection of powerful tools.",
"DG.plugin.Sampler.tab.devices": "Model",
"DG.plugin.Sampler.tab.measures": "Measures"
"DG.plugin.Sampler.tab.measures": "Measures",
"DG.plugin.Sampler.measures.instructions": "Compute common measures for each sample using the template below.",
"DG.plugin.Sampler.measures.select-measure": "Select a measure: ",
"DG.plugin.Sampler.measures.add-measure": "Add Measure",
"DG.plugin.Sampler.measures.mean": "Mean",
"DG.plugin.Sampler.measures.mean-formula": "mean",
"DG.plugin.Sampler.measures.conditional_mean": "Conditional mean",
"DG.plugin.Sampler.measures.conditional_mean-formula": "mean",
"DG.plugin.Sampler.measures.difference_of_means": "Difference of means",
"DG.plugin.Sampler.measures.difference_of_means-formula-pt-1": "mean",
"DG.plugin.Sampler.measures.difference_of_means-formula-pt-2": "– mean",
"DG.plugin.Sampler.measures.sum": "Sum",
"DG.plugin.Sampler.measures.sum-formula": "sum",
"DG.plugin.Sampler.measures.median": "Median",
"DG.plugin.Sampler.measures.median-formula": "median",
"DG.plugin.Sampler.measures.conditional_median": "Conditional median",
"DG.plugin.Sampler.measures.conditional_median-formula": "median",
"DG.plugin.Sampler.measures.difference_of_medians": "Difference of medians",
"DG.plugin.Sampler.measures.difference_of_medians-formula-pt-1": "median",
"DG.plugin.Sampler.measures.difference_of_medians-formula-pt-2": " - median",
"DG.plugin.Sampler.measures.conditional_sum": "Conditional sum",
"DG.plugin.Sampler.measures.conditional_sum-formula": "sum",
"DG.plugin.Sampler.measures.select-formula": "Select a formula: ",
"DG.plugin.Sampler.measures.count": "Count",
"DG.plugin.Sampler.measures.count-formula": "count",
"DG.plugin.Sampler.measures.percent": "Percent",
"DG.plugin.Sampler.measures.percent-formula-pt-1": "100 * count",
"DG.plugin.Sampler.measures.percent-formula-pt-2": " / count( )",
"DG.plugin.Sampler.measures.name-label": "Name the measure: "
},
"de": {
"DG.plugin.Importer.title": "CSV importieren",
Expand Down Expand Up @@ -548,7 +576,8 @@
"DG.plugin.MicrodataPortal.title": "Portal mikrodanych",
"DG.plugin.NOAA-weather.description": "Zbadaj historyczne wzorce pogodowe.",
"DG.plugin.Choosy.description": "Organizuj i upraszczaj zestawy danych z wieloma atrybutami.",
"DG.plugin.Transformers.description": "Transformuj zbiory danych za pomocą zestawu zaawansowanych narzędzi."
"DG.plugin.Transformers.description": "Transformuj zbiory danych za pomocą zestawu zaawansowanych narzędzi.",
"DG.plugin.Sampler.tab.measures": "Miary"
},
"pt-br": {
"DG.plugin.Importer.title": "Importar CSV",
Expand Down
56 changes: 28 additions & 28 deletions TP-Sampler/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,51 +71,51 @@
</div>
<div id="measures" class="hidden">
<div id="measures-top">
<div id="measures-instructions" data-text="DG.plugin.Sampler.measures-instructions"></div>
<div id="measures-instructions" data-text="DG.plugin.Sampler.measures.instructions"></div>
<div id="select-measure-container">
<label for="select-measure" id="select-measure-label" data-text="DG.plugin.Sampler.select-measure"></label>
<label for="select-measure" id="select-measure-label" data-text="DG.plugin.Sampler.measures.select-measure"></label>
<select id="select-measure">
<option id="default" disabled selected value="">Select a formula</option>
<option id="count" value="count" data-text="DG.plugin.Sampler.count"></option>
<option id="sum" value="sum" data-text="DG.plugin.Sampler.sum"></option>
<option id="mean" value="mean" data-text="DG.plugin.Sampler.mean"></option>
<option id="median" value="median" data-text="DG.plugin.Sampler.median"></option>
<!-- <option id="conditional_sum" value="conditional_sum" data-text="DG.plugin.Sampler.conditional_sum"></option> -->
<option id="percent" value="percent" data-text="DG.plugin.Sampler.percent"></option>
<!-- <option id="conditional_mean" value="conditional_mean" data-text="DG.plugin.Sampler.conditional_mean"></option> -->
<!-- <option id="conditional_median" value="conditional_median" data-text="DG.plugin.Sampler.conditional_median"></option> -->
<!-- <option id="difference_of_means" value="difference_of_means" data-text="DG.plugin.Sampler.difference_of_means"></option> -->
<!-- <option id="difference_of_medians" value="difference_of_medians" data-text="DG.plugin.Sampler.difference_of_medians"></option> -->
<option id="default" disabled selected value="" data-text="DG.plugin.Sampler.measures.select-formula"></option>
<option id="count" value="count" data-text="DG.plugin.Sampler.measures.count"></option>
<option id="sum" value="sum" data-text="DG.plugin.Sampler.measures.sum"></option>
<option id="mean" value="mean" data-text="DG.plugin.Sampler.measures.mean"></option>
<option id="median" value="median" data-text="DG.plugin.Sampler.measures.median"></option>
<!-- <option id="conditional_sum" value="conditional_sum" data-text="DG.plugin.Sampler.measures.conditional_sum"></option> -->
<option id="percent" value="percent" data-text="DG.plugin.Sampler.measures.percent"></option>
<!-- <option id="conditional_mean" value="conditional_mean" data-text="DG.plugin.Sampler.measures.conditional_mean"></option> -->
<!-- <option id="conditional_median" value="conditional_median" data-text="DG.plugin.Sampler.measures.conditional_median"></option> -->
<!-- <option id="difference_of_means" value="difference_of_means" data-text="DG.plugin.Sampler.measures.difference_of_means"></option> -->
<!-- <option id="difference_of_medians" value="difference_of_medians" data-text="DG.plugin.Sampler.measures.difference_of_medians"></option> -->
</select>
</div>
<div id="measure-name-container">
<label for="measure-name" id="measure-name-label" data-text="DG.plugin.Sampler.measure-name-label"></label>
<label for="measure-name" id="measure-name-label" data-text="DG.plugin.Sampler.measures.name-label"></label>
<input type="text" id="measure-name"></input>
</div>
<div id="measure-formulas">
<div id="sum-formula-container" class="formula hidden">
<span id="sum-formula" data-text="DG.plugin.Sampler.sum-formula"></span>
<span id="sum-formula" data-text="DG.plugin.Sampler.measures.sum-formula"></span>
<span class="formula-paren">(
<select id="sum-select-attribute">
</select>
)</span>
</div>
<div id="mean-formula-container" class="formula hidden">
<span id="mean-formula" data-text="DG.plugin.Sampler.mean-formula"></span>
<span id="mean-formula" data-text="DG.plugin.Sampler.measures.mean-formula"></span>
<span class="formula-paren">(
<select id="mean-select-attribute">
</select>
)</span>
</div>
<div id="median-formula-container" class="formula hidden">
<span id="median-formula" data-text="DG.plugin.Sampler.median-formula"></span>
<span id="median-formula" data-text="DG.plugin.Sampler.measures.median-formula"></span>
<span class="formula-paren">(
<select id="median-select-attribute">
</select>
)</span>
</div>
<div id="count-formula-container" class="formula hidden">
<span id="count-formula" data-text="DG.plugin.Sampler.count-formula"></span>
<span id="count-formula" data-text="DG.plugin.Sampler.measures.count-formula"></span>
<span class="formula-paren">(
<select id="count-select-attribute">
</select>
Expand All @@ -126,7 +126,7 @@
)</span>
</div>
<div id="conditional_sum-formula-container" class="formula hidden">
<span id="conditional_sum-formula" data-text="DG.plugin.Sampler.conditional_sum-formula"></span>
<span id="conditional_sum-formula" data-text="DG.plugin.Sampler.measures.conditional_sum-formula"></span>
<span class="formula-paren">(
<select id="conditional_sum-select-attribute">
</select> ,
Expand All @@ -139,7 +139,7 @@
)</span>
</div>
<div id="percent-formula-container" class="formula hidden">
<span id="percent-formula" data-text="DG.plugin.Sampler.percent-formula-pt-1"></span>
<span id="percent-formula" data-text="DG.plugin.Sampler.measures.percent-formula-pt-1"></span>
<span class="formula-paren">(
<select id="percent-select-attribute">
</select>
Expand All @@ -148,10 +148,10 @@
<select id="percent-select-value">
</select>
)</span>
<span id="percent-formula" data-text="DG.plugin.Sampler.percent-formula-pt-2"></span>
<span id="percent-formula" data-text="DG.plugin.Sampler.measures.percent-formula-pt-2"></span>
</div>
<div id="conditional_mean-formula-container" class="formula hidden">
<span id="conditional_mean-formula" data-text="DG.plugin.Sampler.conditional_mean-formula"></span>
<span id="conditional_mean-formula" data-text="DG.plugin.Sampler.measures.conditional_mean-formula"></span>
<span class="formula-paren">(
<select id="conditional_mean-select-attribute">
</select> ,
Expand All @@ -164,7 +164,7 @@
)</span>
</div>
<div id="conditional_median-formula-container" class="formula hidden">
<span id="conditional_median-formula" data-text="DG.plugin.Sampler.conditional_median-formula"></span>
<span id="conditional_median-formula" data-text="DG.plugin.Sampler.measures.conditional_median-formula"></span>
<span class="formula-paren">(
<select id="conditional_median-select-attribute">
</select> ,
Expand All @@ -177,7 +177,7 @@
)</span>
</div>
<div id="difference_of_means-formula-container" class="formula hidden">
<span id="difference_of_means-formula-pt-1" data-text="DG.plugin.Sampler.difference_of_means-formula-pt-1"></span>
<span id="difference_of_means-formula-pt-1" data-text="DG.plugin.Sampler.measures.difference_of_means-formula-pt-1"></span>
<span class="formula-paren">(
<select id="difference_of_means-select-attribute-pt-1">
</select> ,
Expand All @@ -188,7 +188,7 @@
<select id="difference_of_means-select-value-pt-1">
</select>
)</span>
<span id="difference_of_means-formula-pt-2" data-text="DG.plugin.Sampler.difference_of_means-formula-pt-2"></span>
<span id="difference_of_means-formula-pt-2" data-text="DG.plugin.Sampler.measures.difference_of_means-formula-pt-2"></span>
<span class="formula-paren">(
<select id="difference_of_means-select-attribute-pt-2">
</select> ,
Expand All @@ -201,7 +201,7 @@
)</span>
</div>
<div id="difference_of_medians-formula-container" class="formula hidden">
<span id="difference_of_medians-formula-pt-1" data-text="DG.plugin.Sampler.difference_of_medians-formula-pt-1"></span>
<span id="difference_of_medians-formula-pt-1" data-text="DG.plugin.Sampler.measures.difference_of_medians-formula-pt-1"></span>
<span class="formula-paren">(
<select id="difference_of_medians-select-attribute-pt-1">
</select> ,
Expand All @@ -212,7 +212,7 @@
<select id="difference_of_medians-select-value-pt-1">
</select>
)</span>
<span id="difference_of_means-formula-pt-2" data-text="DG.plugin.Sampler.difference_of_medians-formula-pt-2"></span>
<span id="difference_of_means-formula-pt-2" data-text="DG.plugin.Sampler.measures.difference_of_medians-formula-pt-2"></span>
<span class="formula-paren">(
<select id="difference_of_medians-select-attribute-pt-2">
</select> ,
Expand All @@ -227,7 +227,7 @@
</div>
</div>
<div id="measures-bottom">
<button id="add-measure" data-text="DG.plugin.Sampler.add-measure" class="disabled"></button>
<button id="add-measure" data-text="DG.plugin.Sampler.measures.add-measure" class="disabled"></button>
</div>
</div>
<div id="options" class="hidden">
Expand Down
5 changes: 3 additions & 2 deletions TP-Sampler/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,9 @@ function stopButtonPressed() {

function resetButtonPressed() {
this.blur();
experimentNumber = 1;
experimentNumber = 0;
mostRecentRunNumber = 0;
previousSampleSize = null;
codapCom.deleteAll();
// we used to delete all attributes, and recreate them if we were a collector.
// we don't do that any more because it seems to take a very long time, and the request
Expand Down Expand Up @@ -487,7 +488,7 @@ function run() {
])
}

if( tDescription + tStringifiedVariables !== previousExperimentDescription ||
if( experimentNumber === 0 || tDescription + tStringifiedVariables !== previousExperimentDescription ||
(previousSampleSize !== null && previousSampleSize !== tSampleSize)) {
experimentNumber++;
previousExperimentDescription = tDescription + tStringifiedVariables;
Expand Down
33 changes: 31 additions & 2 deletions TP-Sampler/src/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,35 @@
"DG.plugin.Transformers.title": "Transformers",
"DG.plugin.Transformers.description": "Transform datasets with a collection of powerful tools.",
"DG.plugin.Sampler.tab.devices": "Model",
"DG.plugin.Sampler.tab.measures": "Measures"
"DG.plugin.Sampler.tab.measures": "Measures",
"DG.plugin.Sampler.measures.instructions": "Compute common measures for each sample using the template below.",
"DG.plugin.Sampler.measures.select-measure": "Select a measure: ",
"DG.plugin.Sampler.measures.add-measure": "Add Measure",
"DG.plugin.Sampler.measures.mean": "Mean",
"DG.plugin.Sampler.measures.mean-formula": "mean",
"DG.plugin.Sampler.measures.conditional_mean": "Conditional mean",
"DG.plugin.Sampler.measures.conditional_mean-formula": "mean",
"DG.plugin.Sampler.measures.difference_of_means": "Difference of means",
"DG.plugin.Sampler.measures.difference_of_means-formula-pt-1": "mean",
"DG.plugin.Sampler.measures.difference_of_means-formula-pt-2": "– mean",
"DG.plugin.Sampler.measures.sum": "Sum",
"DG.plugin.Sampler.measures.sum-formula": "sum",
"DG.plugin.Sampler.measures.median": "Median",
"DG.plugin.Sampler.measures.median-formula": "median",
"DG.plugin.Sampler.measures.conditional_median": "Conditional median",
"DG.plugin.Sampler.measures.conditional_median-formula": "median",
"DG.plugin.Sampler.measures.difference_of_medians": "Difference of medians",
"DG.plugin.Sampler.measures.difference_of_medians-formula-pt-1": "median",
"DG.plugin.Sampler.measures.difference_of_medians-formula-pt-2": " - median",
"DG.plugin.Sampler.measures.conditional_sum": "Conditional sum",
"DG.plugin.Sampler.measures.conditional_sum-formula": "sum",
"DG.plugin.Sampler.measures.select-formula": "Select a formula: ",
"DG.plugin.Sampler.measures.count": "Count",
"DG.plugin.Sampler.measures.count-formula": "count",
"DG.plugin.Sampler.measures.percent": "Percent",
"DG.plugin.Sampler.measures.percent-formula-pt-1": "100 * count",
"DG.plugin.Sampler.measures.percent-formula-pt-2": " / count( )",
"DG.plugin.Sampler.measures.name-label": "Name the measure: "
},
"de": {
"DG.plugin.Importer.title": "CSV importieren",
Expand Down Expand Up @@ -548,7 +576,8 @@
"DG.plugin.MicrodataPortal.title": "Portal mikrodanych",
"DG.plugin.NOAA-weather.description": "Zbadaj historyczne wzorce pogodowe.",
"DG.plugin.Choosy.description": "Organizuj i upraszczaj zestawy danych z wieloma atrybutami.",
"DG.plugin.Transformers.description": "Transformuj zbiory danych za pomocą zestawu zaawansowanych narzędzi."
"DG.plugin.Transformers.description": "Transformuj zbiory danych za pomocą zestawu zaawansowanych narzędzi.",
"DG.plugin.Sampler.tab.measures": "Miary"
},
"pt-br": {
"DG.plugin.Importer.title": "Importar CSV",
Expand Down
2 changes: 1 addition & 1 deletion lib/build-num.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0062
0063
14 changes: 3 additions & 11 deletions onboarding/Readme.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
### tutorial

This is a React-based data interactive plugin. We translate from JSX to plain javascript
at build time. Right now this is done with the build task in `package.json`.
The file `./src/onboarding.jsx` is the single source file for this implementation.
It is converted into `./js/onboarding.js`. If you change this data interactive
you should edit the `.jsx` file and run the build task to update the `.js`. If
things get more complicated we will introduce a more sophisticated build process.

### To get started

- npm install
- npm run build

### Translations
These plugins are localizable using the [CODAP Getting Started Project on POEditor](https://poeditor.com/projects/view?id=683807). To translate these into another language, add that language on POEditor and the use `npm run strings:pull` to download the latest changes across all language translations.


This data-interactive plugin is not deployable in the usual way that plugins in this codap-data-interactives directory are because it relies on same-origin for the drag of the data file into CODAP.
The getting started plugin at index.html is not deployable in the usual way that plugins in this codap-data-interactives directory are because it relies on same-origin for the drag of the data file into CODAP.

It is normally deployed to the codap.concord.org/plugins server.
6 changes: 2 additions & 4 deletions onboarding/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
#
# Build the onboarding deployment
TARGET=./target
JSX_SOURCE=source/jsx
HTML_SOURCE=source/*.html
CSS_SOURCE=source/style/onboarding.css
STRINGS_SOURCE=source/strings.json
JS_SOURCE=source/js
CODAP_INTERFACE_SOURCE=../Common/js/CodapInterface.js
IFRAME_PHONE_SOURCE=../Common/js/iframe-phone.js
RESOURCE_SOURCE=source/resources

mkdir $TARGET
npm run build-onboarding
npm run build-task_descriptions
npm run build-task_descriptions_2

cp $HTML_SOURCE $TARGET
cp $CSS_SOURCE $TARGET
cp $STRINGS_SOURCE $TARGET
cp -r $RESOURCE_SOURCE $TARGET
cp $JS_SOURCE/* $TARGET
cp $CODAP_INTERFACE_SOURCE $TARGET
Expand Down
Loading

0 comments on commit ef34fac

Please sign in to comment.