Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
prodige
bdl-alkante-visualiseur-core
Commits
e9bc223c
Commit
e9bc223c
authored
Oct 27, 2022
by
Jenkins
Browse files
Merge commit '
0ce48865
'
parents
76176830
0ce48865
Changes
3
Hide whitespace changes
Inline
Side-by-side
projects/visualiseur-core/src/lib/chart/chart.component.ts
View file @
e9bc223c
...
...
@@ -29,15 +29,15 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
@
ViewChildren
(
'
containerID
'
)
queryContainerID
:
QueryList
<
ElementRef
>
;
@
ViewChild
(
'
containerID
'
)
containerID
:
ElementRef
;
pr
ivate
chartIsInit
=
false
;
pr
otected
chartIsInit
=
false
;
pr
ivate
querySubscription
:
Subscription
;
pr
otected
querySubscription
:
Subscription
;
pr
ivate
colorDefault
=
[
'
#165f10
'
,
'
#58b311
'
,
'
#d6df0b
'
,
'
#80290f
'
,
'
#0f2c80
'
];
pr
otected
colorDefault
=
[
'
#165f10
'
,
'
#58b311
'
,
'
#d6df0b
'
,
'
#80290f
'
,
'
#0f2c80
'
];
pr
ivate
datas
=
{};
pr
otected
datas
=
{};
pr
ivate
labelOnChartParam
=
{
pr
otected
labelOnChartParam
=
{
color
:
'
#FFF
'
,
anchor
:
'
center
'
,
align
:
'
end
'
,
...
...
@@ -61,7 +61,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
@
Input
()
withValueOnChart
=
false
;
@
Input
()
fontStyle
:
string
;
pr
ivate
htmlLegendPlugin
=
{
pr
otected
htmlLegendPlugin
=
{
id
:
'
htmlLegend
'
,
afterUpdate
:
(
chart
)
=>
{
const
ul
=
this
.
getOrCreateLegendList
();
...
...
@@ -186,7 +186,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
pr
ivate
buildDataSet
(
datas
)
{
pr
otected
buildDataSet
(
datas
)
{
const
retour
=
[];
const
newColor
=
[];
...
...
@@ -207,7 +207,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
return
retour
;
}
pr
ivate
filterData
(
datas
)
{
pr
otected
filterData
(
datas
)
{
const
retour
=
{};
const
newColor
=
[];
Object
.
entries
(
datas
).
forEach
(([
key
,
value
],
idx
)
=>
{
...
...
@@ -223,13 +223,13 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
return
retour
;
}
pr
ivate
barChart
(
ctx
:
HTMLCanvasElement
)
{
pr
otected
barChart
(
ctx
:
HTMLCanvasElement
)
{
const
ctx2d
=
ctx
.
getContext
(
'
2d
'
);
const
dataSets
=
this
.
buildDataSet
(
this
.
datas
);
this
.
labelOnChartParam
.
align
=
'
end
'
;
this
.
labelOnChartParam
.
anchor
=
'
en
d
'
;
this
.
labelOnChartParam
.
anchor
=
'
c
en
ter
'
;
this
.
labelOnChartParam
.
color
=
'
black
'
;
this
.
labelOnChartParam
.
font
.
weight
=
'
normal
'
;
...
...
@@ -265,7 +265,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
},
);
}
pr
ivate
pieChart
(
ctx
:
HTMLCanvasElement
)
{
pr
otected
pieChart
(
ctx
:
HTMLCanvasElement
)
{
const
ctx2d
=
ctx
.
getContext
(
'
2d
'
);
const
dataFilter
=
this
.
filterData
(
this
.
datas
);
...
...
@@ -313,7 +313,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
pr
ivate
getOrCreateLegendList
()
{
pr
otected
getOrCreateLegendList
()
{
const
legendContainer
=
this
.
containerID
.
nativeElement
;
let
listContainer
=
legendContainer
.
querySelector
(
'
ul
'
);
...
...
projects/visualiseur-core/src/lib/models/option-impression.ts
View file @
e9bc223c
...
...
@@ -14,7 +14,9 @@
* projection: "urn:ogc:def:crs:EPSG::2154",
* center: [563401.85717836,6792415.9857373],
* zoom: 12
* }
* },
* header: "Titre du pdf",
* footer: "Pied de page du pdf"
* }
* ```
*/
...
...
@@ -36,6 +38,12 @@ export interface OptionImpression{
/** Pour centrer la vue de la carte sur un point */
view
?:
ImpressionView
;
/** entête */
header
:
string
;
/** pied de page */
footer
:
string
;
}
export
interface
ImpressionView
{
...
...
projects/visualiseur-core/src/lib/pipes/information-sheet-filter.pipe.ts
View file @
e9bc223c
...
...
@@ -6,16 +6,20 @@ import {toFixed} from 'ol/math';
})
export
class
InformationSheetFilterPipe
implements
PipeTransform
{
transform
(
value
:
number
|
string
|
boolean
,
digit
:
number
=
null
):
number
|
string
{
transform
(
value
:
number
|
string
|
boolean
,
digit
:
number
=
null
,
local
:
string
=
'
fr-Fr
'
):
number
|
string
{
if
(
typeof
digit
===
'
string
'
){
digit
=
parseInt
(
digit
,
10
);
}
if
(
!
value
&&
value
!==
0
&&
value
!==
false
)
{
return
'
Données indisponibles
'
;
}
else
if
(
value
===
true
||
value
===
false
)
{
return
value
?
'
Oui
'
:
'
Non
'
;
}
else
if
(
isFinite
(
value
as
number
))
{
if
(
digit
)
{
if
(
digit
||
digit
===
0
)
{
value
=
toFixed
(
value
as
number
,
digit
);
}
return
value
.
toLocaleString
();
return
value
.
toLocaleString
(
local
);
}
else
{
return
value
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment