Skip to content

Commit 2a957c6

Browse files
committed
mimerender-cookiecutter 0.17.0
1 parent f04a50e commit 2a957c6

29 files changed

+396
-722
lines changed

.cookiecutter.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default_context:
2+
author_name: "Grant Nestor"
3+
author_email: "grantnestor@gmail.com"
4+
mime_type: "application/vnd.dataresource+json"
5+
file_extension: "table.json"
6+
mime_short_name: "JSONTable"
7+
extension_name: "jupyterlab_table"

README.md

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# jupyterlab_table
22

3-
A JupyterLab and Jupyter Notebook extension for rendering [JSON Table Schema](http://frictionlessdata.io/guides/json-table-schema/)
3+
A JupyterLab and Jupyter Notebook extension for rendering JSONTable
44

5-
![output renderer](http://g.recordit.co/l9WLsSxPPd.gif)
5+
![output renderer](http://g.recordit.co/QAsC7YULcY.gif)
66

77
## Prerequisites
88

9-
* JupyterLab ^0.16.0 and/or Notebook >=4.3.0
9+
* JupyterLab ^0.17.0 and/or Notebook >=4.3.0
1010

1111
## Usage
1212

@@ -15,73 +15,19 @@ To render JSONTable output in IPython:
1515
```python
1616
from jupyterlab_table import JSONTable
1717

18-
JSONTable(data=[
19-
{
20-
"Date": "2000-03-01",
21-
"Adj Close": 33.68,
22-
"Open": 89.62,
23-
"Low": 88.94,
24-
"Volume": 106889800,
25-
"High": 94.09,
26-
"Close": 90.81
27-
},
28-
{
29-
"Date": "2000-03-02",
30-
"Adj Close": 34.63,
31-
"Open": 91.81,
32-
"Low": 91.12,
33-
"Volume": 106932600,
34-
"High": 95.37,
35-
"Close": 93.37
18+
JSONTable({
19+
"string": "string",
20+
"array": [1, 2, 3],
21+
"bool": True,
22+
"object": {
23+
"foo": "bar"
3624
}
37-
], schema={
38-
"fields": [
39-
{
40-
"type": "any",
41-
"name": "Date"
42-
},
43-
{
44-
"type": "number",
45-
"name": "Open"
46-
},
47-
{
48-
"type": "number",
49-
"name": "High"
50-
},
51-
{
52-
"type": "number",
53-
"name": "Low"
54-
},
55-
{
56-
"type": "number",
57-
"name": "Close"
58-
},
59-
{
60-
"type": "integer",
61-
"name": "Volume"
62-
},
63-
{
64-
"type": "number",
65-
"name": "Adj Close"
66-
}
67-
]
6825
})
6926
```
7027

71-
Using a pandas DataFrame:
28+
To render a `.table.json` file as a tree, simply open it:
7229

73-
```python
74-
from jupyterlab_table import JSONTable
75-
import pandas
76-
import numpy
77-
78-
df = pandas.DataFrame(numpy.random.randn(2, 2))
79-
JSONTable(df)
80-
```
81-
82-
To render a .table.json file as a tree, simply open it:
83-
84-
![file renderer](http://g.recordit.co/7BNlGqlKtP.gif)
30+
![file renderer](http://g.recordit.co/cbf0xnQHKn.gif)
8531

8632
## Install
8733

RELEASE.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@ This document guides an extension maintainer through creating and publishing a r
44

55
## Update version number
66

7-
Update the version number in `setup.py` and in `package.json`.
7+
Update the version number in `setup.py`, `labextension/package.json`, and `nbextension/package.json`.
8+
9+
Commit your changes, add git tag for this version, and push both commit and tag to your origin/remote repo.
810

911
## Remove generated files
1012

11-
Remove old Javascript bundle builds and delete the `dist/` folder to remove old Python package builds:
13+
Remove old Javascript bundle and Python package builds:
1214

1315
```bash
14-
npm run clean
15-
rm -rf dist/
16+
git clean -xfd
1617
```
1718

1819
## Build the package
1920

2021
Build the Javascript extension bundle, then build the Python package and wheel:
2122

2223
```bash
23-
npm run build
24+
bash build.js
2425
python setup.py sdist
2526
python setup.py bdist_wheel --universal
2627
```

component/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# jupyterlab_table
2+
3+
The React component(s)
4+
5+
## Structure
6+
7+
* `index.js`: Entry point for React component(s)
8+
* `index.css`: Optional CSS file for styling React component(s)
9+
* `package.json`: Node package configuration, use this to add npm depedencies

component/fixed-data-table.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

component/index.css

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,3 @@
1-
.fixedDataTableLayout_main {
2-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
3-
font-size: 14px;
4-
}
5-
6-
.public_fixedDataTableCell_main {
7-
border-color: #ddd;
8-
}
9-
10-
.public_fixedDataTable_header {
11-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
12-
font-size: 14px;
13-
}
14-
15-
.public_fixedDataTable_header {
16-
background: #fff;
17-
}
18-
19-
.public_fixedDataTable_header, .public_fixedDataTable_header .public_fixedDataTableCell_main {
20-
background: #fff;
21-
text-align: center;
22-
}
23-
24-
.public_fixedDataTableCell_cellContent {
25-
padding: 6px 13px;
26-
}
27-
28-
.public_fixedDataTableRow_highlighted, .public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main {
29-
background: #f8f8f8;
30-
}
31-
32-
.dataframe {
33-
width: 100%;
34-
border-spacing: 1px;
35-
}
36-
37-
.dataframe .header {
38-
text-align: right;
1+
.JSONTable {
2+
393
}

component/index.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
export VirtualizedTable from './virtualized-table';
2-
export VirtualizedGrid from './virtualized-grid';
3-
export FixedDataTable from './fixed-data-table';
4-
export VanillaTable from './vanilla-table';
1+
import React from 'react';
2+
import './index.css';
3+
4+
export default class JSONTableComponent extends React.Component {
5+
6+
render() {
7+
return (
8+
<div className="JSONTable">
9+
{JSON.stringify(this.props.data)}
10+
</div>
11+
);
12+
}
13+
14+
}

component/package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "react-json-table",
2+
"name": "jupyterlab_table_react",
33
"version": "1.0.0",
4-
"description": "A React component for rendering JSON schema table",
4+
"description": "A React component for rendering JSONTable",
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
@@ -10,13 +10,9 @@
1010
"jupyter",
1111
"react"
1212
],
13-
"author": "Grant Nestor",
13+
"author": "Grant Nestor <grantnestor@gmail.com>",
1414
"license": "ISC",
1515
"dependencies": {
16-
"fixed-data-table": "^0.6.3",
17-
"jsontableschema": "^0.2.2",
18-
"react": "^15.3.2",
19-
"react-addons-shallow-compare": "^15.4.2",
20-
"react-virtualized": "^8.11.4"
16+
"react": "^15.3.2"
2117
}
2218
}

component/vanilla-table.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)