Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
0fdd82a2
Unverified
Commit
0fdd82a2
authored
3 years ago
by
Kyle Doherty
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add basic static-viz internal route and examples (#17172)
parent
cadd7101
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/internal/pages/StaticVizPage.jsx
+71
-0
71 additions, 0 deletions
frontend/src/metabase/internal/pages/StaticVizPage.jsx
frontend/src/metabase/internal/routes.js
+2
-0
2 additions, 0 deletions
frontend/src/metabase/internal/routes.js
with
73 additions
and
0 deletions
frontend/src/metabase/internal/pages/StaticVizPage.jsx
0 → 100644
+
71
−
0
View file @
0fdd82a2
import
React
from
"
react
"
;
import
{
Box
}
from
"
grid-styled
"
;
import
Heading
from
"
metabase/components/type/Heading
"
;
import
Subhead
from
"
metabase/components/type/Subhead
"
;
import
Text
from
"
metabase/components/type/Text
"
;
import
{
RenderChart
}
from
"
../../static-viz/
"
;
export
default
function
StaticVizPage
()
{
return
(
<
Box
py
=
{
4
}
>
<
Box
className
=
"wrapper wrapper--trim"
>
<
Heading
>
Static Visualisations
</
Heading
>
<
Text
>
These visualizations are used in dashboard subscriptions. They have no
interactivity and get generated by the backend to be sent to Slack or
in emails. You can use this playground to work on the source code in
/static-viz/ and see the effects. You might need to hard refresh to
see updates.
</
Text
>
<
Box
py
=
{
3
}
>
<
Subhead
>
Bar chart with timeseries data
</
Subhead
>
<
Box
dangerouslySetInnerHTML
=
{
{
__html
:
RenderChart
(
"
timeseries/bar
"
,
{
data
:
[[
"
2010-11-07
"
,
20
],
[
"
2020-11-07
"
,
30
]],
accessors
:
{
x
:
row
=>
new
Date
(
row
[
0
]).
valueOf
(),
y
:
row
=>
row
[
1
],
},
}),
}
}
></
Box
>
</
Box
>
<
Box
py
=
{
3
}
>
<
Subhead
>
Line chart with timeseries data
</
Subhead
>
<
Box
dangerouslySetInnerHTML
=
{
{
__html
:
RenderChart
(
"
timeseries/line
"
,
{
data
:
[
[
"
2010-11-07
"
,
20
],
[
"
2020-11-07
"
,
30
],
[
"
2021-11-07
"
,
31
],
],
accessors
:
{
x
:
row
=>
new
Date
(
row
[
0
]).
valueOf
(),
y
:
row
=>
row
[
1
],
},
}),
}
}
></
Box
>
</
Box
>
<
Box
py
=
{
3
}
>
<
Subhead
>
Donut chart showing categorical data
</
Subhead
>
<
Box
dangerouslySetInnerHTML
=
{
{
__html
:
RenderChart
(
"
categorical/donut
"
,
{
data
:
[[
"
donut
"
,
20
],
[
"
cronut
"
,
31
]],
accessors
:
{
dimension
:
row
=>
row
[
0
],
metric
:
row
=>
row
[
1
],
},
}),
}
}
></
Box
>
</
Box
>
</
Box
>
</
Box
>
);
}
This diff is collapsed.
Click to expand it.
frontend/src/metabase/internal/routes.js
+
2
−
0
View file @
0fdd82a2
...
...
@@ -28,6 +28,7 @@ import IconsPage from "metabase/internal/pages/IconsPage";
import
ColorsPage
from
"
metabase/internal/pages/ColorsPage
"
;
import
ComponentsPage
from
"
metabase/internal/pages/ComponentsPage
"
;
import
ModalsPage
from
"
metabase/internal/pages/ModalsPage
"
;
import
StaticVizPage
from
"
metabase/internal/pages/StaticVizPage
"
;
import
{
InternalLayout
}
from
"
metabase/internal/components/Layout
"
;
...
...
@@ -42,6 +43,7 @@ export default (
<
Route
path
=
"
colors
"
component
=
{
ColorsPage
}
/
>
<
Route
path
=
"
components/:componentName
"
component
=
{
ComponentsPage
}
/
>
<
Route
path
=
"
modals
"
component
=
{
ModalsPage
}
/
>
<
Route
path
=
"
static-viz
"
component
=
{
StaticVizPage
}
/
>
{
/* Legacy App pages - not really style guide related, but keep for now */
}
{
Object
.
entries
(
APPS
).
map
(
([
name
,
Component
])
=>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment