-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
302 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: default | ||
title: How to use board | ||
--- | ||
|
||
# How to use board | ||
Here's an example code regarding the use of board: | ||
|
||
```yaml | ||
--- | ||
dashboard "Example": | ||
- | ||
board: | ||
- | ||
rows: | ||
- | ||
pie chart: | ||
columns: | ||
- | ||
- "Apples" | ||
- 3 | ||
- | ||
- "Oranges" | ||
- 2 | ||
- | ||
- "Pears" | ||
- 2 | ||
- | ||
p text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dolor massa, luctus rhoncus justo vel, cursus placerat ligula. Proin pulvinar ipsum in enim rutrum, quis fermentum ex finibus. Nunc commodo urna tellus, tristique tempor magna tempor eget. Phasellus eu ex lacinia sapien viverra fermentum." | ||
|
||
``` | ||
The code above will render a board that looks like this: | ||
|
||
![](../screenshots/board.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
dashboard "Example": | ||
- | ||
board: | ||
- | ||
rows: | ||
- | ||
pie chart: | ||
columns: | ||
- | ||
- "Apples" | ||
- 3 | ||
- | ||
- "Oranges" | ||
- 2 | ||
- | ||
- "Pears" | ||
- 2 | ||
- | ||
p text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dolor massa, luctus rhoncus justo vel, cursus placerat ligula. Proin pulvinar ipsum in enim rutrum, quis fermentum ex finibus. Nunc commodo urna tellus, tristique tempor magna tempor eget. Phasellus eu ex lacinia sapien viverra fermentum." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,5 +99,6 @@ | |
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
} | ||
}, | ||
"browserlist": ["last 10 versions"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ContainerComponent from '../container_base.js' | ||
import Wrapped from '../wrapped' | ||
import './Board.scss' | ||
|
||
const BoardComponent = Wrapped((args, selection) => selection | ||
.append('div') | ||
.attr('class', 'ds--board') | ||
)(ContainerComponent({ | ||
'wrapper_tag': 'div', | ||
})) | ||
|
||
export default BoardComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@import "~sassline/assets/sass/sassline-base/_variables.scss"; | ||
@import "~sassline/assets/sass/sassline-base/_mixins.scss"; | ||
|
||
.ds--board { | ||
margin-left: -(map-get($gutterwidths, medium)); | ||
margin-right: -(map-get($gutterwidths, medium)); | ||
padding: map-get($gutterwidths, medium); | ||
|
||
>* { | ||
>.ds--columns { | ||
margin: 0; | ||
} | ||
>.ds--columns>.ds--column { | ||
box-shadow: 2px 1px 2px #00000026; | ||
border-radius: 3px; | ||
} | ||
>.ds--chart { | ||
box-shadow: 2px 1px 2px #00000026; | ||
border-radius: 3px; | ||
} | ||
} | ||
|
||
/* Hero pattern | ||
http://www.heropatterns.com/ */ | ||
box-shadow: inset 0 0 10px #00000042; | ||
background-color: #dfeaeb; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%2379a9a3' fill-opacity='0.1' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import should from 'should' // eslint-disable-line no-unused-vars | ||
import * as d3 from 'd3' | ||
import assert from 'assert' | ||
|
||
describe('Board component', function() { | ||
beforeEach(function () { | ||
this.jsdom = require('jsdom-global')() | ||
}) | ||
|
||
afterEach(function () { | ||
this.jsdom() | ||
}) | ||
|
||
it('integration test', () => { | ||
const test_parser = require('../../test_parser.js').default | ||
const bind = test_parser({ | ||
'component': 'root', 'args': { 'title': '', 'state_handler': {} }, | ||
'data': [ | ||
{'component': 'board', | ||
'args': {'state_handler': {}}, | ||
'data': [ | ||
{'component': 'text', 'args': {'tagName': 'h4'}, 'data': 'random'} | ||
] | ||
} | ||
] | ||
}) | ||
bind(d3.selection()) | ||
assert.equal(d3.selection().select('.ds--board').size(), 1) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"data": [ | ||
{ | ||
"rows": [ | ||
{"pie chart": {"columns": [["Apples", 3], ["Oranges", 2], ["Pears", 2]]}}, | ||
{"p text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dolor massa, luctus rhoncus justo vel, cursus placerat ligula. Proin pulvinar ipsum in enim rutrum, quis fermentum ex finibus. Nunc commodo urna tellus, tristique tempor magna tempor eget. Phasellus eu ex lacinia sapien viverra fermentum."} | ||
] | ||
} | ||
], | ||
"category": "Grid", | ||
"examples": { | ||
"board": "board" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import BoardComponent from './Board.js' | ||
|
||
export default BoardComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import "~sassline/assets/sass/sassline-base/_variables.scss"; | ||
|
||
.ds--chart { | ||
background: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ds--row { | ||
background: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.