Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
64304daf
Unverified
Commit
64304daf
authored
Oct 19, 2020
by
kay delaney
Committed by
GitHub
Oct 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Webpack: Split out unicons and bizcharts (#28374)
parent
ad657dcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
15 deletions
+32
-15
packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx
+26
-15
scripts/webpack/webpack.common.js
+6
-0
No files found.
packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx
View file @
64304daf
// Libraries
import
React
,
{
CSSProperties
}
from
'react'
;
import
React
,
{
CSSProperties
,
Suspense
}
from
'react'
;
import
tinycolor
from
'tinycolor2'
;
import
{
Chart
,
Geom
}
from
'bizcharts'
;
// Utils
import
{
formattedValueToString
,
DisplayValue
,
getColorForTheme
}
from
'@grafana/data'
;
...
...
@@ -14,6 +13,16 @@ import { getTextColorForBackground } from '../../utils';
const
LINE_HEIGHT
=
1.2
;
const
MAX_TITLE_SIZE
=
30
;
const
Chart
=
React
.
lazy
(
async
()
=>
{
const
{
Chart
}
=
await
import
(
/* webpackChunkName: "bizcharts" */
'bizcharts'
);
return
{
default
:
Chart
};
});
const
Geom
=
React
.
lazy
(
async
()
=>
{
const
{
Geom
}
=
await
import
(
/* webpackChunkName: "bizcharts" */
'bizcharts'
);
return
{
default
:
Geom
};
});
export
abstract
class
BigValueLayout
{
titleFontSize
:
number
;
valueFontSize
:
number
;
...
...
@@ -166,17 +175,19 @@ export abstract class BigValueLayout {
}
return
(
<
Chart
height=
{
this
.
chartHeight
}
width=
{
this
.
chartWidth
}
data=
{
data
}
animate=
{
false
}
padding=
{
[
4
,
0
,
0
,
0
]
}
scale=
{
scales
}
style=
{
this
.
getChartStyles
()
}
>
{
this
.
renderGeom
()
}
</
Chart
>
<
Suspense
fallback=
{
<
div
>
Loading chart...
</
div
>
}
>
<
Chart
height=
{
this
.
chartHeight
}
width=
{
this
.
chartWidth
}
data=
{
data
}
animate=
{
false
}
padding=
{
[
4
,
0
,
0
,
0
]
}
scale=
{
scales
}
style=
{
this
.
getChartStyles
()
}
>
{
this
.
renderGeom
()
}
</
Chart
>
</
Suspense
>
);
}
...
...
@@ -209,10 +220,10 @@ export abstract class BigValueLayout {
lineStyle
.
stroke
=
lineColor
;
return
(
<>
<
Suspense
fallback=
{
<
div
>
Loading chart...
</
div
>
}
>
<
Geom
type=
"area"
position=
"time*value"
size=
{
0
}
color=
{
fillColor
}
style=
{
lineStyle
}
shape=
"smooth"
/>
<
Geom
type=
"line"
position=
"time*value"
size=
{
1
}
color=
{
lineColor
}
style=
{
lineStyle
}
shape=
"smooth"
/>
</>
</
Suspense
>
);
}
...
...
scripts/webpack/webpack.common.js
View file @
64304daf
...
...
@@ -180,6 +180,12 @@ module.exports = {
chunks
:
'all'
,
minChunks
:
1
,
cacheGroups
:
{
unicons
:
{
test
:
/
[\\/]
node_modules
[\\/]
@iconscout
[\\/]
react-unicons
[\\/]
.*
[
jt
]
sx
?
$/
,
chunks
:
'initial'
,
priority
:
20
,
enforce
:
true
,
},
moment
:
{
test
:
/
[\\/]
node_modules
[\\/]
moment
[\\/]
.*
[
jt
]
sx
?
$/
,
chunks
:
'initial'
,
...
...
Write
Preview
Markdown
is supported
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