Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1b6dcd4
[data-explorer][m]: refactored to work with data explorer concept.
anuveyatsu Aug 13, 2019
fbf0545
[package][m]: Package App for distribution
starsinmypockets Aug 13, 2019
2ee2811
[Chart][m]: added Chart component for rendering graphs from simple spec.
anuveyatsu Aug 14, 2019
6ffcd88
[package][m]: Add dist files
starsinmypockets Aug 14, 2019
5813902
[tidy up][s]: refactored App.js to remove redundant code.
anuveyatsu Aug 21, 2019
8623a76
[fixtures][xs]: fix loading fixture.
anuveyatsu Aug 21, 2019
bb21a7f
[fixtures][xs]: fix failed fixture.
anuveyatsu Aug 21, 2019
a34b37e
[fixtures][xs]: fix map fixture.
anuveyatsu Aug 21, 2019
1d16720
[Map][s]: fix popup on markers so it uses 'feature.properties.name' t…
anuveyatsu Aug 21, 2019
f1f16f8
[tests][xs]: mock Chart component as Plotly lib errors when running t…
anuveyatsu Aug 21, 2019
59da284
[tabularmap][m]: basic implementation of tabular map, eg, building Ma…
anuveyatsu Aug 21, 2019
9b26c5b
[tabularmap][xs]: fix confused order of lon and lat so that first one…
anuveyatsu Aug 21, 2019
98893c3
[tabularmap][m]: support JS string templates.
anuveyatsu Aug 21, 2019
9d72cf7
[setup][l]: moved utils function into new module + implemented handli…
anuveyatsu Aug 21, 2019
f7ea252
[tests][xl]: fixtures and tests for auto detecting geometry fields
anuveyatsu Aug 21, 2019
dceda6a
Merge pull request #20 from datopian/feature/maps
anuveyatsu Aug 22, 2019
ebb9f78
[build:package]: to use it in data explorer
anuveyatsu Aug 22, 2019
9f09b3e
[Map][xs]: zoom to fit all markers on the map
anuveyatsu Aug 22, 2019
68e57d2
[tests][s]: If running in JSDOM, we need to avoid using 'bounds' prop…
anuveyatsu Aug 22, 2019
792f21a
[Map][xs]: if no geo data in tabular data then render empty div eleme…
anuveyatsu Aug 22, 2019
5d81f4a
[bug fix][xs]: don't fail if no schema provided
anuveyatsu Aug 22, 2019
1344af9
[setup][m]: use index.js for public interface only and setup all fixt…
anuveyatsu Aug 26, 2019
3ac275b
[Map][s]: fix bug in Map renderer so simple GeoJSON also renders OK.
anuveyatsu Aug 26, 2019
f84fe30
[setup][xs]: package name update to invlude org name + major version …
anuveyatsu Aug 26, 2019
f841841
Merge branch 'master' into refactor/data-views
anuveyatsu Aug 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ More [below](https://github.com/datopian/datapackage-views-js/blob/master/README

**To see the app populated with views run `yarn dev` and visit `localhost:8989`**

- `yarn build:package` will use babel to compile the package to /dist for distribution

## cosmos
We are using [cosmos](https://github.com/react-cosmos/) to mock datasets and test components.

Expand Down
73 changes: 73 additions & 0 deletions __fixtures__/chart.fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { DataView } from '../src/index'

const datapackage = {
"views": [
{
"id": 1,
"resources": [
{
"name": "test",
"schema": {
"fields": [
{
"name": "a",
"type": "integer"
},
{
"name": "b",
"type": "integer"
},
{
"name": "c",
"type": "integer"
},
{
"name": "d",
"type": "integer"
}
]
},
"data": [
[
"a",
"b",
"c",
"d"
],
[
1,
2,
3,
4
],
[
2,
3,
4,
5
],
[
3,
4,
5,
6
]
]
}
],
"specType": "simple",
"spec": {
"type": "line",
"group": "a",
"series": ["b", "c", "d"]
}
}
]
}

const loading = false

export default {
component: DataView,
props: {datapackage, loading}
};
28 changes: 17 additions & 11 deletions __fixtures__/document.fixtures.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import App from '../src/App.js'
import { DataView } from '../src/index'

const view = {
"id": 1,
"resources": [
const datapackage = {
"views": [
{
"name": "test",
"format": "pdf",
"path": "http://www.africau.edu/images/default/sample.pdf"
"id": 1,
"resources": [
{
"name": "test",
"format": "pdf",
"path": "http://www.africau.edu/images/default/sample.pdf"
}
],
"specType": "document"
}
],
"specType": "document"
]
}

const loading = false

export default {
component: App,
props: {view}
component: DataView,
props: {datapackage, loading}
};
26 changes: 15 additions & 11 deletions __fixtures__/failed.fixtures.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import App from '../src/App.js'
import { DataView } from '../src/index'

const view = {
"id": 1,
"resources": [
const datapackage = {
"views": [
{
"name": "test",
"path": "http://example.com/data",
"unavailable": true
"id": 1,
"resources": [
{
"name": "test",
"path": "http://example.com/data",
"unavailable": true
}
],
"specType": "table"
}
],
"specType": "table"
]
}

export default {
component: App,
props: {view}
component: DataView,
props: {datapackage}
};
24 changes: 15 additions & 9 deletions __fixtures__/loading.fixtures.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import App from '../src/App.js'
import { DataView } from '../src/index'

const view = {
"id": 1,
"resources": [
"test"
],
"specType": "table"
const datapackage = {
"views": [
{
"id": 1,
"resources": [
"test"
],
"specType": "table"
}
]
}

const loading = true

export default {
component: App,
props: {view}
component: DataView,
props: {datapackage, loading}
};
48 changes: 27 additions & 21 deletions __fixtures__/map.fixtures.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
import App from '../src/App.js'
import { DataView } from '../src/index'

const view = {
"id": 1,
"resources": [
const datapackage = {
"views": [
{
"name": "test",
"data": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
125.6,
10.1
]
},
"properties": {
"name": "Dinagat Islands"
"id": 1,
"resources": [
{
"name": "test",
"data": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
125.6,
10.1
]
},
"properties": {
"name": "Dinagat Islands"
}
}
}
}
],
"specType": "map"
}
],
"specType": "map"
]
}

const loading = false

export default {
component: App,
props: {view}
component: DataView,
props: {datapackage, loading}
};
56 changes: 41 additions & 15 deletions __fixtures__/table.fixtures.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
import App from '../src/App.js'
import { DataView } from '../src/index'

const view = {
"id": 1,
"resources": [
const datapackage = {
"views": [
{
"name": "test",
"data": [
["a", "b", "c", "d"],
[1, 2, 3, 4],
[2, 3, 4, 5],
[3, 4, 5, 6]
]
"id": 1,
"resources": [
{
"name": "test",
"_values": [
[
"a",
"b",
"c",
"d"
],
[
1,
2,
3,
4
],
[
2,
3,
4,
5
],
[
3,
4,
5,
6
]
]
}
],
"specType": "table"
}
],
"specType": "table"
]
}

const loading = false

export default {
component: App,
props: {view}
component: DataView,
props: {datapackage, loading}
};
48 changes: 48 additions & 0 deletions __fixtures__/tabularmap/auto-detect.fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { DataView } from '../../src/index'

const datapackage = {
"views": [
{
"id": 1,
"resources": [
{
"name": "test",
"schema": {
"fields": [
{
"name": "lon",
"type": "number"
},
{
"name": "lat",
"type": "number"
},
{
"name": "label",
"type": "string"
}
]
},
"_values": [
{
"lon": 125.6,
"lat": 10.1,
"label": "My marker on the map 1"
},
{
"lon": 125.6,
"lat": 10.2,
"label": "My marker on the map 2"
}
]
}
],
"specType": "tabularmap"
}
]
}

export default {
component: DataView,
props: {datapackage, loading: false}
};
42 changes: 42 additions & 0 deletions __fixtures__/tabularmap/geometry-field-array.fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { DataView } from '../../src/index'

const datapackage = {
"views": [
{
"id": 1,
"resources": [
{
"name": "test",
"schema": {
"fields": [
{
"name": "geojson",
"type": "array"
},
{
"name": "label",
"type": "string"
}
]
},
"_values": [
{
"geojson": [125.6, 10.1],
"label": "My marker on the map 1"
},
{
"geojson": [125.6, 10.2],
"label": "My marker on the map 2"
}
]
}
],
"specType": "tabularmap"
}
]
}

export default {
component: DataView,
props: {datapackage, loading: false}
};
Loading