Skip to content

Commit

Permalink
Merge pull request #74 from openHPI/so/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes and improvements
  • Loading branch information
janrenz authored Aug 30, 2018
2 parents ab81dba + 723f15b commit 0547438
Show file tree
Hide file tree
Showing 13 changed files with 5,452 additions and 165 deletions.
6 changes: 6 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const gulp = require('gulp');
const tap = require('gulp-tap');
const file = require('gulp-file');
const gulpif = require('gulp-if');
const babel = require('gulp-babel');
const clean = require('gulp-clean');
const insert = require('gulp-insert');
const merge = require('merge-stream');
Expand All @@ -16,6 +17,7 @@ const browserify = require('browserify');
const intoStream = require('into-stream');
const runSequence = require('run-sequence');
const Bundler = require('polymer-bundler').Bundler;
const HtmlSplitter = require('polymer-build').HtmlSplitter;

const POLYMER_MANIFEST_PATH = 'src/all-imports.html';
const PLOTLY_PARTIALS_PATH = [
Expand All @@ -42,8 +44,12 @@ gulp.task('bundle-core', () => {
const bundler = new Bundler();
return bundler.generateManifest([POLYMER_MANIFEST_PATH]).then((manifest) => {
return bundler.bundle(manifest).then((result) => {
let htmlSplitter = new HtmlSplitter();
let bundleDocument = result.documents.values().next().value;
return file('core.html', bundleDocument.content)
.pipe(htmlSplitter.split())
.pipe(gulpif(/\.js$/, babel({plugins: ["transform-es2015-arrow-functions"]})))
.pipe(htmlSplitter.rejoin())
.pipe(gulp.dest('dist'));
});
});
Expand Down
2 changes: 1 addition & 1 deletion demo/data_control/ajax_wrapper_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3>ajax-wrapper demo (custom element)</h3>
</ajax-wrapper>

<!-- URL returns 404 response -->
<ajax-wrapper data-url="http://www.mocky.io/v2/5b1691ce31000091006f3fa1" error-text="Error while loading data">
<ajax-wrapper data-url="http://www.mocky.io/v2/5b1691ce31000091006f3fa1" error-text="Error while loading data" refresh-interval="5000">
<score-card primarycolor="#c1c1c1" icon-classes="fas fa-user" name="Total Users"></score-card>
</ajax-wrapper>
</template>
Expand Down
19 changes: 18 additions & 1 deletion demo/data_control/data_selector_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,24 @@ <h3>data-selector demo (custom element)</h3>
<data-selector keys='["data", 0, "questions"]' data='{"data": [{"total_enrollments": 8567, "questions": 210}]}'>
<score-card primarycolor="#c1c1c1" icon-classes="fas fa-question" name="Total Questions"></score-card>
</data-selector>
</ajax-wrapper>

<!-- Data
{
"data": [
{
"total_enrollments": 8567,
"questions": 210
}
]
}
-->
<data-selector key='data' data='{"data": [{"total_enrollments": 8567, "questions": 210}]}'>
<data-selector key='0'>
<data-selector key='questions'>
<score-card primarycolor="#c1c1c1" icon-classes="fas fa-question" name="Total Questions"></score-card>
</data-selector>
</data-selector>
</data-selector>
</template>
</demo-snippet>
</div>
Expand Down
20 changes: 20 additions & 0 deletions demo/visualizations/vennchart_basic_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ <h3>vennchart-basic demo (custom element)</h3>
]
-->
<vennchart-basic data='[{"sets":["A"],"size":12,"label":"A"},{"sets":["B"],"size":12,"label":"B"},{"sets":["A","B"],"size":2}]'></vennchart-basic>

<!-- Data
[
{
"sets": ["A"],
"size": 12,
"label": "A"
},
{
"sets": ["B"],
"size": 12,
"label": "B"
},
{
"sets": ["A", "B"],
"size": 2
}
]
-->
<vennchart-basic data='[{"sets":["A"],"size":12,"label":"A"},{"sets":["B"],"size":12,"label":"B"},{"sets":["A","B"],"size":2}]' blacklist='["B"]'></vennchart-basic>
</template>
</demo-snippet>
</div>
Expand Down
Loading

0 comments on commit 0547438

Please sign in to comment.