-
Notifications
You must be signed in to change notification settings - Fork 29
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
1 parent
4999ed5
commit f2c37ac
Showing
12 changed files
with
175 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import ReactHighcharts from "react-highcharts"; | ||
|
||
const CustomBarChart = ({ error, isLoading, result }) => { | ||
if (isLoading) { | ||
return <span>Loading…</span>; | ||
} | ||
|
||
if (error) { | ||
return <span>Something went wrong :-(</span>; | ||
} | ||
|
||
if (result) { | ||
const config = { | ||
chart: { | ||
type: "column", | ||
}, | ||
title: { | ||
text: "🎉🍾🙌 Custom Chart 🙌🍾🎉", | ||
}, | ||
series: result | ||
.data() | ||
.slices() | ||
.toArray() | ||
.map(slice => ({ data: [parseFloat(slice.rawData()[0])] })), | ||
}; | ||
|
||
return <ReactHighcharts config={config} />; | ||
} | ||
|
||
return <span>Init…</span>; | ||
}; | ||
|
||
export default CustomBarChart; |
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
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,38 @@ | ||
import React from "react"; | ||
import { InsightView } from "@gooddata/sdk-ui-ext"; | ||
import { ColumnChart } from "@gooddata/sdk-ui-charts"; | ||
import { newMeasure, newAttribute } from "@gooddata/sdk-model"; | ||
import { Execute } from "@gooddata/sdk-ui"; | ||
|
||
import Page from "../components/Page"; | ||
import CustomBarChart from "../components/CustomBarChart"; | ||
import config from "../config"; | ||
|
||
import styles from "./GDUIComponents.module.scss"; | ||
|
||
const GDUIComponents = () => { | ||
return ( | ||
<Page contentClassName={styles.GDUIComponents}> | ||
<div className={styles.Insight}> | ||
<InsightView insight={config.insightIdentifier} config={{ legend: { position: "right" } }} /> | ||
</div> | ||
<div className={styles.Insight}> | ||
<ColumnChart | ||
measures={[newMeasure(config.insightMeasure)]} | ||
viewBy={newAttribute(config.insightViewByAttribute)} | ||
stackBy={newAttribute(config.insightStackByAttribute)} | ||
config={{ legend: { position: "right" } }} | ||
/> | ||
</div> | ||
<div className={styles.Insight}> | ||
<Execute | ||
seriesBy={[newMeasure(config.insightMeasure)]} | ||
slicesBy={[newAttribute(config.insightViewByAttribute)]} | ||
children={CustomBarChart} | ||
/> | ||
</div> | ||
</Page> | ||
); | ||
}; | ||
|
||
export default GDUIComponents; |
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,7 @@ | ||
.GDUIComponents { | ||
padding: 20px; | ||
|
||
.Insight { | ||
height: 400px; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,33 +1,7 @@ | ||
.Home { | ||
display: flex; | ||
padding: 56px 0 0 0; | ||
margin: 0; | ||
width: 100%; | ||
max-width: none; | ||
|
||
.Nav { | ||
width: 255px; | ||
|
||
.Link { | ||
text-decoration: none; | ||
|
||
&.LinkActive { | ||
font-weight: bold; | ||
} | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
|
||
.Content { | ||
flex: 1 0 auto; | ||
|
||
iframe { | ||
border: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
iframe { | ||
border: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7387,6 +7387,11 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-7.1.1.tgz#8c4433e39d5e7dbdc064685d9548181a35e12c19" | ||
integrity sha512-BQtWDQmH4AweQNFLGJCHBQwv9tj9kyp35bp2FFpmNBm7LOecCQdLjvZNgUKvCsKzBzJJIywcwWu4QEcAkPGCjg== | ||
|
||
highcharts@^6.0.4: | ||
version "6.2.0" | ||
resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-6.2.0.tgz#2a6d04652eb43c66f462ca7e2d2808f1f2782b61" | ||
integrity sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== | ||
|
||
highlight-es@^1.0.0: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/highlight-es/-/highlight-es-1.0.3.tgz#12abc300a27e686f6f18010134e3a5c6d2fe6930" | ||
|
@@ -11958,6 +11963,13 @@ react-helmet@^5.2.1: | |
react-fast-compare "^2.0.2" | ||
react-side-effect "^1.1.0" | ||
|
||
react-highcharts@^16.1.0: | ||
version "16.1.0" | ||
resolved "https://registry.yarnpkg.com/react-highcharts/-/react-highcharts-16.1.0.tgz#aa2d451171197462e07fa8652a42bac43da6068a" | ||
integrity sha512-CHpCSMN96lXKeTIpx8UJPsUgeNeJqh81NN6cbzraiHQBiQz2mzXa5aaIWYbMEQ2NHhAEWU5uj5DPhZY1f1Rq+A== | ||
dependencies: | ||
highcharts "^6.0.4" | ||
|
||
react-input-autosize@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-3.0.0.tgz#6b5898c790d4478d69420b55441fcc31d5c50a85" | ||
|