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
09213c0c
Unverified
Commit
09213c0c
authored
7 years ago
by
Kyle Doherty
Browse files
Options
Downloads
Patches
Plain Diff
show periodicity for date fields
parent
3763abb2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/xray/Histogram.jsx
+2
-2
2 additions, 2 deletions
frontend/src/metabase/xray/Histogram.jsx
frontend/src/metabase/xray/containers/FieldXray.jsx
+19
-1
19 additions, 1 deletion
frontend/src/metabase/xray/containers/FieldXray.jsx
with
21 additions
and
3 deletions
frontend/src/metabase/xray/Histogram.jsx
+
2
−
2
View file @
09213c0c
import
React
from
'
react
'
import
Visualization
from
'
metabase/visualizations/components/Visualization
'
const
Histogram
=
({
fingerprint
})
=>
const
Histogram
=
({
histogram
})
=>
<
Visualization
className
=
"full-height"
series
=
{
[
...
...
@@ -10,7 +10,7 @@ const Histogram = ({ fingerprint }) =>
display
:
"
bar
"
,
visualization_settings
:
{}
},
data
:
fingerprint
.
histogram
data
:
histogram
}
]
}
showTitle
=
{
false
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/xray/containers/FieldXray.jsx
+
19
−
1
View file @
09213c0c
...
...
@@ -16,6 +16,9 @@ import CostSelect from 'metabase/xray/components/CostSelect'
import
Histogram
from
'
metabase/xray/Histogram
'
import
SimpleStat
from
'
metabase/xray/SimpleStat
'
import
{
isDate
}
from
'
metabase/lib/schema_metadata
'
const
PERIODICITY
=
[
'
day
'
,
'
week
'
,
'
month
'
,
'
hour
'
,
'
quarter
'
]
type
Props
=
{
fetchFieldFingerPrint
:
()
=>
void
,
...
...
@@ -103,7 +106,7 @@ class FieldXRay extends Component {
<
div
className
=
"mt4"
>
<
h3
className
=
"py2 border-bottom"
>
Distribution
</
h3
>
<
div
className
=
"my4"
style
=
{
{
height
:
300
,
width
:
'
100%
'
}
}
>
<
Histogram
fingerprint
=
{
fingerprint
}
/>
<
Histogram
histogram
=
{
fingerprint
.
histogram
}
/>
</
div
>
</
div
>
...
...
@@ -120,6 +123,21 @@ class FieldXRay extends Component {
</
div
>
</
div
>
{
isDate
(
fingerprint
.
field
)
&&
[
<
Heading
heading
=
"Periodicity"
/>,
<
div
className
=
"Grid Grid--gutters"
>
{
PERIODICITY
.
map
(
period
=>
fingerprint
[
`histogram-
${
period
}
`
]
&&
(
<
div
className
=
"Grid-cell"
style
=
{
{
height
:
120
}
}
>
<
Histogram
histogram
=
{
fingerprint
[
`histogram-
${
period
}
`
]
}
/>
</
div
>
)
)
}
</
div
>
]
}
<
a
className
=
"link"
onClick
=
{
()
=>
this
.
setState
({
showRaw
:
!
this
.
state
.
showRaw
})
}
>
{
this
.
state
.
showRaw
?
'
Hide
'
:
'
Show
'
}
raw response (debug)
</
a
>
...
...
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