Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
a6e8007d
Commit
a6e8007d
authored
7 years ago
by
Michael Lange
Browse files
Options
Download
Email Patches
Plain Diff
Add jumbo distribution bar to the styleguide
parent
62dbb273
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ui/app/components/freestyle/sg-distribution-bar-jumbo.js
+13
-0
ui/app/components/freestyle/sg-distribution-bar-jumbo.js
ui/app/templates/components/freestyle/sg-distribution-bar-jumbo.hbs
+25
-0
...plates/components/freestyle/sg-distribution-bar-jumbo.hbs
with
38 additions
and
0 deletions
+38
-0
ui/app/components/freestyle/sg-distribution-bar-jumbo.js
0 → 100644
+
13
-
0
View file @
a6e8007d
import
Component
from
'
@ember/component
'
;
import
{
computed
}
from
'
@ember/object
'
;
export
default
Component
.
extend
({
distributionBarData
:
computed
(()
=>
{
return
[
{
label
:
'
one
'
,
value
:
10
},
{
label
:
'
two
'
,
value
:
20
},
{
label
:
'
three
'
,
value
:
0
},
{
label
:
'
four
'
,
value
:
35
},
];
}),
});
This diff is collapsed.
Click to expand it.
ui/app/templates/components/freestyle/sg-distribution-bar-jumbo.hbs
0 → 100644
+
25
-
0
View file @
a6e8007d
{{#
freestyle-usage
"jumbo-distribution-bar"
}}
{{#
distribution-bar
data
=
distributionBarData
class
=
"split-view"
as
|
chart
|
}}
<ol
class=
"legend"
>
{{#
each
chart
.
data
as
|
datum
index
|
}}
<li
class=
"
{{
datum
.
className
}}
{{
if
(
eq
datum
.
index
chart
.
activeDatum
.
index
)
"is-active"
}}
{{
if
(
eq
datum
.
value
0
)
"is-empty"
}}
"
>
<span
class=
"color-swatch
{{
if
datum
.
className
datum
.
className
(
concat
"swatch-"
index
)
}}
"
/>
<span
class=
"value"
data-test-legend-value=
"
{{
datum
.
className
}}
"
>
{{
datum
.
value
}}
</span>
<span
class=
"label"
>
{{
datum
.
label
}}
</span>
</li>
{{/
each
}}
</ol>
{{/
distribution-bar
}}
{{/
freestyle-usage
}}
{{#
freestyle-annotation
}}
<div
class=
"block"
>
A variation of the Distribution Bar component for when the distribution bar is the central component of the page. It's a larger format that requires no interaction to see the data labels and values.
</div>
<div
class=
"boxed-section"
>
<div
class=
"boxed-section-body is-dark"
>
{{
json-viewer
json
=
distributionBarData
}}
</div>
</div>
{{/
freestyle-annotation
}}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help