paper bg for doleance done!

This commit is contained in:
Bachir Soussi Chiadmi 2023-06-06 11:18:42 +02:00
parent 6afc3f945f
commit 3b1565c82f

View File

@ -709,8 +709,6 @@ export default {
return g; return g;
}, },
setPaperDoleanceBG(){ setPaperDoleanceBG(){
let children = [];
var r = this.ray * this.scale * 0.8; // ray var r = this.ray * this.scale * 0.8; // ray
var dr = r/2; // demi ray var dr = r/2; // demi ray
var d = r*2; // diameter var d = r*2; // diameter
@ -739,7 +737,7 @@ export default {
let style = { let style = {
strokeColor: '#fff', strokeColor: '#fff',
strokeWidth: 1 strokeWidth: 2
} }
let legende_style = { let legende_style = {
@ -749,207 +747,353 @@ export default {
let fontsize = 2.1; let fontsize = 2.1;
// arcs exterieur let children = [
// ARCS EXTERIEURS
// haut gauche // haut gauche
children.push(new paper.Path.Arc({ new paper.Path.Arc({
from: [this.pos.x - r, this.pos.y - pcr], from: [this.pos.x - r, this.pos.y - pcr],
through: [this.pos.x - m, this.pos.y - m], through: [this.pos.x - m, this.pos.y - m],
to: [this.pos.x - pcr, this.pos.y - r], to: [this.pos.x - pcr, this.pos.y - r],
style: style style: style
})); }),
// haut droite // haut droite
children.push(new paper.Path.Arc({ new paper.Path.Arc({
from: [this.pos.x + pcr, this.pos.y - r], from: [this.pos.x + pcr, this.pos.y - r],
through: [this.pos.x + m, this.pos.y - m], through: [this.pos.x + m, this.pos.y - m],
to: [this.pos.x + r, this.pos.y - pcr], to: [this.pos.x + r, this.pos.y - pcr],
style: style style: style
})); }),
// bas droite // bas droite
children.push(new paper.Path.Arc({ new paper.Path.Arc({
from: [this.pos.x + r, this.pos.y + pcr], from: [this.pos.x + r, this.pos.y + pcr],
through: [this.pos.x + m, this.pos.y + m], through: [this.pos.x + m, this.pos.y + m],
to: [this.pos.x + pcr, this.pos.y + r], to: [this.pos.x + pcr, this.pos.y + r],
style: style style: style
})); }),
// bas gauche // bas gauche
children.push(new paper.Path.Arc({ new paper.Path.Arc({
from: [this.pos.x - pcr, this.pos.y + r], from: [this.pos.x - pcr, this.pos.y + r],
through: [this.pos.x - m, this.pos.y + m], through: [this.pos.x - m, this.pos.y + m],
to: [this.pos.x - r, this.pos.y + pcr], to: [this.pos.x - r, this.pos.y + pcr],
style: style style: style
})); }),
//
// legendes // cercle interieur
// ARC bas gauche 1 new paper.Path.Circle({
children.push(new paper.Path.Arc({ center: [this.pos.x, this.pos.y],
radius: dr,
style: style
}),
//
// petit cercles
new paper.Path.Circle({
center: [this.pos.x, this.pos.y -r],
radius: pcr,
style: style
}),
new paper.Path.Circle({
center: [this.pos.x, this.pos.y + r],
radius: pcr,
style: style
}),
new paper.Path.Circle({
center: [this.pos.x + r, this.pos.y],
radius: pcr,
style: style
}),
new paper.Path.Circle({
center: [this.pos.x -r, this.pos.y],
radius: pcr,
style: style
}),
//
// AXES
// vertical haut
new paper.Path.Line({
from: [this.pos.x, this.pos.y - r + pcr],
to: [this.pos.x , this.pos.y - dr],
style: style
}),
// vertical bas
new paper.Path.Line({
from: [this.pos.x, this.pos.y + r - pcr],
to: [this.pos.x , this.pos.y + dr],
style: style
}),
// horizontal gauche
new paper.Path.Line({
from: [this.pos.x - r + pcr, this.pos.y],
to: [this.pos.x - dr, this.pos.y],
style: style
}),
// horizontal droite
new paper.Path.Line({
from: [this.pos.x + r - pcr, this.pos.y],
to: [this.pos.x + dr, this.pos.y],
style: style
}),
//
// DIAGONALES
new paper.Path.Line({
from: [this.pos.x + m, this.pos.y + m],
to: [this.pos.x + n, this.pos.y + n],
style: style
}),
new paper.Path.Line({
from: [this.pos.x - m, this.pos.y + m],
to: [this.pos.x - n, this.pos.y + n],
style: style
}),
new paper.Path.Line({
from: [this.pos.x + m, this.pos.y - m],
to: [this.pos.x + n, this.pos.y - n],
style: style
}),
new paper.Path.Line({
from: [this.pos.x - m, this.pos.y - m],
to: [this.pos.x - n, this.pos.y - n],
style: style
}),
// fleches
// haut
new paper.Path({
segments: [
[this.pos.x - 2, this.pos.y - dr*1.5 - 2],
[this.pos.x, this.pos.y - dr*1.5],
[this.pos.x - 2, this.pos.y - dr*1.5 + 2]
],
style: style
}),
// bas
new paper.Path({
segments: [
[this.pos.x + 2, this.pos.y + dr*1.5 - 2],
[this.pos.x, this.pos.y + dr*1.5],
[this.pos.x + 2, this.pos.y + dr*1.5 + 2]
],
style: style
}),
// gauche
new paper.Path({
segments: [
[this.pos.x - dr*1.5 - 2, this.pos.y + 2],
[this.pos.x - dr*1.5, this.pos.y],
[this.pos.x - dr*1.5 + 2, this.pos.y + 2]
],
style: style
}),
// droite
new paper.Path({
segments: [
[this.pos.x + dr*1.5 - 2, this.pos.y - 2],
[this.pos.x + dr*1.5, this.pos.y],
[this.pos.x + dr*1.5 + 2, this.pos.y - 2]
],
style: style
}),
//
// LEGENDES
//
// arc bas gauche 1
new paper.Path.Arc({
from: [this.pos.x - pcr, this.pos.y + lar], from: [this.pos.x - pcr, this.pos.y + lar],
through: [this.pos.x - p, this.pos.y + o], through: [this.pos.x - p, this.pos.y + o],
to: [this.pos.x - q + pcr/2, this.pos.y + q + pcr/2], to: [this.pos.x - q + pcr/2, this.pos.y + q + pcr/2],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x - p_t, this.pos.y + o_t], new paper.Path.Line({
from: [this.pos.x - p, this.pos.y + o],
to: [this.pos.x - p_t, this.pos.y + o_t],
style: legende_style
}),
//text
new paper.PointText({
point: [this.pos.x - p_t - 1, this.pos.y + o_t],
content: "Enquête menée\nsur le terrain de vie", content: "Enquête menée\nsur le terrain de vie",
fontSize: fontsize, fontSize: fontsize,
justification: 'right' justification: 'right'
})); }),
// arc bas gauche 2
// ARC bas gauche 2 new paper.Path.Arc({
children.push(new paper.Path.Arc({
from: [this.pos.x - q - pcr/2, this.pos.y + q - pcr/2], from: [this.pos.x - q - pcr/2, this.pos.y + q - pcr/2],
through: [this.pos.x - o, this.pos.y + p], through: [this.pos.x - o, this.pos.y + p],
to: [this.pos.x - lar, this.pos.y + pcr], to: [this.pos.x - lar, this.pos.y + pcr],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x - o_t, this.pos.y + p_t], new paper.Path.Line({
from: [this.pos.x - o, this.pos.y + p],
to: [this.pos.x - o_t, this.pos.y + p_t],
style: legende_style
}),
// texte
new paper.PointText({
point: [this.pos.x - o_t - 1, this.pos.y + p_t],
content: "Construction de groupes d'intérets\navec qui composer la doléance", content: "Construction de groupes d'intérets\navec qui composer la doléance",
fontSize: fontsize, fontSize: fontsize,
justification: 'right' justification: 'right'
})); }),
// arc haut gauche
// ARC haut gauche new paper.Path.Arc({
children.push(new paper.Path.Arc({
from: [this.pos.x - lar, this.pos.y - pcr], from: [this.pos.x - lar, this.pos.y - pcr],
through: [this.pos.x - q, this.pos.y - q], through: [this.pos.x - q, this.pos.y - q],
to: [this.pos.x - pcr, this.pos.y - lar], to: [this.pos.x - pcr, this.pos.y - lar],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x - q_t, this.pos.y - q_t], new paper.Path.Line({
from: [this.pos.x - q, this.pos.y - q],
to: [this.pos.x - q_t, this.pos.y - q_t],
style: legende_style
}),
// texte
new paper.PointText({
point: [this.pos.x - q_t - 1, this.pos.y - q_t],
content: "Réception et traitement\nde la doléance", content: "Réception et traitement\nde la doléance",
fontSize: fontsize, fontSize: fontsize,
justification: 'right' justification: 'right'
})); }),
// arc haut droite
// ARC haut droite new paper.Path.Arc({
children.push(new paper.Path.Arc({
from: [this.pos.x + pcr, this.pos.y - lar], from: [this.pos.x + pcr, this.pos.y - lar],
through: [this.pos.x + q, this.pos.y - q], through: [this.pos.x + q, this.pos.y - q],
to: [this.pos.x + lar, this.pos.y - pcr], to: [this.pos.x + lar, this.pos.y - pcr],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x + q_t, this.pos.y - q_t], new paper.Path.Line({
from: [this.pos.x + q, this.pos.y - q],
to: [this.pos.x + q_t, this.pos.y - q_t],
style: legende_style
}),
// texte
new paper.PointText({
point: [this.pos.x + q_t + 1, this.pos.y - q_t],
content: "Mise-en-œuvre\nde la décision", content: "Mise-en-œuvre\nde la décision",
fontSize: fontsize, fontSize: fontsize,
justification: 'left' justification: 'left'
})); }),
// arc bas droite 1
// ARC bas droite 1 new paper.Path.Arc({
children.push(new paper.Path.Arc({
from: [this.pos.x + lar, this.pos.y + pcr], from: [this.pos.x + lar, this.pos.y + pcr],
through: [this.pos.x + o, this.pos.y + p], through: [this.pos.x + o, this.pos.y + p],
to: [this.pos.x + q + pcr/2, this.pos.y + q - pcr/2], to: [this.pos.x + q + pcr/2, this.pos.y + q - pcr/2],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x + o_t, this.pos.y + p_t], new paper.Path.Line({
from: [this.pos.x + o, this.pos.y + p],
to: [this.pos.x + o_t, this.pos.y + p_t],
style: legende_style
}),
// texte
new paper.PointText({
point: [this.pos.x + o_t + 1, this.pos.y + p_t],
content: "Réception et application\nde la décision", content: "Réception et application\nde la décision",
fontSize: fontsize, fontSize: fontsize,
justification: 'left' justification: 'left'
})); }),
// arc bas droite 2
// ARC bas droite 2 new paper.Path.Arc({
children.push(new paper.Path.Arc({
from: [this.pos.x + q - pcr/2, this.pos.y + q + pcr/2], from: [this.pos.x + q - pcr/2, this.pos.y + q + pcr/2],
through: [this.pos.x + p, this.pos.y + o], through: [this.pos.x + p, this.pos.y + o],
to: [this.pos.x + pcr, this.pos.y + lar], to: [this.pos.x + pcr, this.pos.y + lar],
style: legende_style style: legende_style
})); }),
children.push(new paper.PointText({ // tiret
point: [this.pos.x + p_t, this.pos.y + o_t], new paper.Path.Line({
from: [this.pos.x + p, this.pos.y + o],
to: [this.pos.x + p_t, this.pos.y + o_t],
style: legende_style
}),
// texte
new paper.PointText({
point: [this.pos.x + p_t + 1, this.pos.y + o_t],
content: "Réussite / échec / reprise\ndu cercle politique", content: "Réussite / échec / reprise\ndu cercle politique",
fontSize: fontsize, fontSize: fontsize,
justification: 'left' justification: 'left'
})); }),
//
// legendes petits cercles
// cercle interieur
children.push(new paper.Path.Circle({
center: [this.pos.x, this.pos.y],
radius: dr,
style: style
}));
// petit cercles
children.push(new paper.Path.Circle({
center: [this.pos.x, this.pos.y -r],
radius: pcr,
style: style
}));
children.push(new paper.Path.Circle({
center: [this.pos.x, this.pos.y + r],
radius: pcr,
style: style
}));
children.push(new paper.Path.Circle({
center: [this.pos.x + r, this.pos.y],
radius: pcr,
style: style
}));
children.push(new paper.Path.Circle({
center: [this.pos.x -r, this.pos.y],
radius: pcr,
style: style
}));
// axes
// vertical
// haut // haut
children.push(new paper.Path.Line({ new paper.Path.Circle({
from: [this.pos.x, this.pos.y - r + pcr], center: [this.pos.x, this.pos.y -r],
to: [this.pos.x , this.pos.y - dr], radius: 0.5,
style: style style: {
})); fillColor: '#000'
}
}),
new paper.Path.Line({
from: [this.pos.x, this.pos.y -r],
to: [this.pos.x, this.pos.y - r - 8],
style: legende_style
}),
new paper.PointText({
point: [this.pos.x, this.pos.y - r - 9],
content: "Décision",
fontSize: fontsize,
justification: 'center'
}),
// bas // bas
children.push(new paper.Path.Line({ new paper.Path.Circle({
from: [this.pos.x, this.pos.y + r - pcr], center: [this.pos.x, this.pos.y + r],
to: [this.pos.x , this.pos.y + dr], radius: 0.5,
style: style style: {
})); fillColor: '#000'
}
// horizontal }),
// gauche new paper.Path.Line({
children.push(new paper.Path.Line({ from: [this.pos.x, this.pos.y + r],
from: [this.pos.x - r + pcr, this.pos.y], to: [this.pos.x, this.pos.y + r + 8],
to: [this.pos.x - dr, this.pos.y], style: legende_style
style: style }),
})); new paper.PointText({
point: [this.pos.x, this.pos.y + r + 10],
content: "Début du cercle\nLe problème\n(injustice, indignation, plainte...)",
fontSize: fontsize,
justification: 'center'
}),
// droite // droite
children.push(new paper.Path.Line({ new paper.Path.Circle({
from: [this.pos.x + r - pcr, this.pos.y], center: [this.pos.x + r, this.pos.y],
to: [this.pos.x + dr, this.pos.y], radius: 0.5,
style: style style: {
})); fillColor: '#000'
}
}),
new paper.Path.Line({
from: [this.pos.x + r, this.pos.y],
to: [this.pos.x + r + 8, this.pos.y],
style: legende_style
}),
new paper.PointText({
point: [this.pos.x + r + 9, this.pos.y - 0.5],
content: "Adresse de la décision\nà appliquer",
fontSize: fontsize,
justification: 'left'
}),
// gauche
new paper.Path.Circle({
center: [this.pos.x -r, this.pos.y],
radius: 0.5,
style: {
fillColor: '#000'
}
}),
new paper.Path.Line({
from: [this.pos.x - r, this.pos.y],
to: [this.pos.x - r - 8, this.pos.y],
style: legende_style
}),
new paper.PointText({
point: [this.pos.x - r - 9, this.pos.y + 0.4],
content: "Adresse de la doléance",
fontSize: fontsize,
justification: 'right'
}),
];
// diagonales
children.push(new paper.Path.Line({
from: [this.pos.x + m, this.pos.y + m],
to: [this.pos.x + n, this.pos.y + n],
style: style
}));
//
children.push(new paper.Path.Line({
from: [this.pos.x - m, this.pos.y + m],
to: [this.pos.x - n, this.pos.y + n],
style: style
}));
//
children.push(new paper.Path.Line({
from: [this.pos.x + m, this.pos.y - m],
to: [this.pos.x + n, this.pos.y - n],
style: style
}));
//
children.push(new paper.Path.Line({
from: [this.pos.x - m, this.pos.y - m],
to: [this.pos.x - n, this.pos.y - n],
style: style
}));
return new paper.Group({ return new paper.Group({
children: children, children: children,
@ -1177,7 +1321,7 @@ export default {
.to({ .to({
s: 7, s: 7,
x: (this.canvas.width - 450) / 2, x: (this.canvas.width - 450) / 2,
y: this.canvas.height / 2 + 50, y: this.canvas.height / 2 + 30,
o: 0.8 o: 0.8
}, 800) }, 800)
.onUpdate((obj) => { .onUpdate((obj) => {