Browse Source

slides et visuels

master
FRANCOIS PELLETIER 10 months ago
parent
commit
3ce7d7bb9d
10 changed files with 361 additions and 1 deletions
  1. +62
    -0
      slides/baxter.dot
  2. BIN
      slides/emoji-2074153_640.png
  3. +43
    -0
      slides/emphase.dot
  4. +1
    -0
      slides/interjections.drawio
  5. BIN
      slides/interjections.png
  6. +37
    -0
      slides/qualite-commentaires.dot
  7. +48
    -0
      slides/role-commentaires.dot
  8. +1
    -1
      textes_articles.ipynb
  9. +167
    -0
      visuels/baxter.html
  10. +2
    -0
      visuels/d3.v5.min.js

+ 62
- 0
slides/baxter.dot View File

@@ -0,0 +1,62 @@
digraph G {
ratio=0.65;
margin=0;
colorscheme=gnbu9;
subgraph cluster_1 {
bgcolor=9;
label="Baxter (2010)";
fontsize=22;
fontcolor=1;
node [colorscheme=gnbu9,
color=2,
shape = box,
style = filled,
fontsize=20];
lang_ana[label="Analyse du discours"]

node [color=3,
fontsize=16]
lang_var[label="variabilité"]
lang_nat[label="nature"]
lang_rep[label="répertoire"]

node [color=4,
fontsize=14]
lang_aud[label="audience"]
lang_con[label="contexte"]
lang_des[label="descriptif"]
lang_nar[label="narratif"]
lang_exp[label="expressif"]
lang_hum[label="humoristique"]
lang_voc[label="vocabulaire"]
lang_gra[label="grammaire"]
lang_sty[label="style"]

node [color=5,
fontsize=12]
lang_soc[label="social"]
lang_pol[label="politique"]
lang_psy[label="psychologique"]
lang_ana -> lang_var
lang_ana -> lang_nat
lang_ana -> lang_rep

lang_var -> lang_aud
lang_var -> lang_con
lang_nat -> lang_des
lang_nat -> lang_nar
lang_nat -> lang_exp
lang_nat -> lang_hum
lang_rep -> lang_voc
lang_rep -> lang_gra
lang_rep -> lang_sty
lang_con -> lang_soc
lang_con -> lang_pol
lang_con -> lang_psy
}
}

BIN
slides/emoji-2074153_640.png View File

Before After
Width: 191  |  Height: 186  |  Size: 62 KiB

+ 43
- 0
slides/emphase.dot View File

@@ -0,0 +1,43 @@
graph G {
colorscheme=purples9;
ratio=0.65;
margin=0;
layout=fdp;
subgraph cluster_1 {
bgcolor=1;
label="Mécanismes d'emphase";
fontsize=24;
node [
colorscheme=purples9,
shape = box,
color = 2,
style = filled,
fontsize=20;];
emo[
label="Emojis",
image="emoji-2074153_640.png",
imagescale=true
]
int[
label="Interjections",
image="interjections.png"
]
maj[label="MAJUSCULES",
fontsize=28]
emp[label="***Emphases***",
fontsize=28]
rep[label="Répééééééééétitions",
fontsize=28]
pon[label="Ponctuation??????",
fontsize=28]
n0[style=invis]
n0--emo[style=invis]
n0--int[style=invis]
n0--maj[style=invis]
n0--emp[style=invis]
n0--rep[style=invis]
n0--pon[style=invis]
}

}

+ 1
- 0
slides/interjections.drawio View File

@@ -0,0 +1 @@
<mxfile host="www.draw.io" modified="2020-01-21T03:55:25.344Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" etag="mKiO3fzlradmMDLuDYvv" version="12.5.5" type="device"><diagram id="_Yyevvpg2XMbApmnufC2" name="Page-1">zVZdb5swFP01PFYKkFDymLKkmZqkU9lU7dGxL2DNYGqcQPrrdwkmhCWVVilt82Kbc7/se44tLDdIq3tF8mQpGQjLGbDKcr9ZjjP0bBxrYNcA/thvgFhx1kB2B4T8FQw4MOiGMyh6jlpKoXneB6nMMqC6hxGlZNl3i6ToV81JDCdASIk4RZ8504k5xWjQ4XPgcdJWtgfGkpLW2QBFQpgsjyB3armBklI3q7QKQNS9a/vSxM3esB42piDT/xPwOnja3tL57xV9ePm1lNPFXLAbk2VLxMYc2HI8gfnuIolpcdd6Z1rhvWxka7gp9kRN0MEZ5lVnrFtMaD8gkCmnaAhJVuC0DI/dvbieF4+Lti4eoCndWEzvDrtwsI15vUSKhNzULmXCNYR5U7ZEFSKW6FTgl43LHBRPQYPqgn500F3EhQikkGqf3o0i8ChFvNBK/oEjC7sdr5HcdktbUBqqN7mwDwzjzQCJ1dQOXUyAZzRhLkUrkbJT2NhAyZG4fIMRo+n4kLejHReG+XeowPkEFfzEjtf0r6DE8UmmJDvVwePy/kp0wAj40VkdeNSHdfQhOrC/WgjuJwhhsaGcEbQEMiskZjtRwWQ2+f5wLToYgc+G53TgO2vX8y6jA/vKHoThxXXQsLcKZ89XQmzkUzj/0K/90XB0oYf+X2I/8IbjZ/czsbcd/ZG5078=</diagram></mxfile>

BIN
slides/interjections.png View File

Before After
Width: 191  |  Height: 181  |  Size: 7.2 KiB

+ 37
- 0
slides/qualite-commentaires.dot View File

@@ -0,0 +1,37 @@
digraph G {
ratio=0.65;
margin=0;
colorscheme=puor8;
subgraph cluster_1 {
bgcolor=8;
label="Qualité des commentaires\nSchultes (2013)";
fontsize=24;
fontcolor=5;
node [colorscheme=puor8,
color=2,
shape = box,
style = filled,
fontsize=20];

mes[label="Qualité"]

node[color=3]

mes1[label="SentiStrength"]
mes2[label="appariement de\nmots-clés"]
mes3[label="ensemble des\ncommentaires"]

node[color=4]

mes21[label="mesure de distance"]
mes11[label="liste de marqueurs\némotionnels"]
mes31[label="capacité de\ndescription"]
mes->mes1
mes1->mes11
mes->mes2
mes2->mes21
mes->mes3
mes3->mes31
}
}

+ 48
- 0
slides/role-commentaires.dot View File

@@ -0,0 +1,48 @@
digraph G {
ratio=0.65;
margin=0;
colorscheme=puor8;
bgcolor=7;
label="Rôle des commentaires\nSchultes (2013)";
fontsize=24;
fontcolor=5;
subgraph cluster_1 {
bgcolor=8;
label="";
node [colorscheme=puor8,
color=2,
shape = box,
style = filled,
fontsize=20];
per[label="Perception"]
node[color=3]
per1[label="agressifs"]
per2[label="stupides"]
per3[label="non\npertinents"]
per->per1
per->per2
per->per3
}

subgraph cluster_2 {
bgcolor=8;
label="";

node [colorscheme=puor8,
color=2,
shape = box,
style = filled,
fontsize=20];
role[label="Rôle"]

node[color=3]
role1[label="discussion"]
role2[label="expérience"]
role3[label="sentiment"]
role->role1
role->role2
role->role3
}
}

+ 1
- 1
textes_articles.ipynb View File

@@ -89,7 +89,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
}
},
"nbformat": 4,


+ 167
- 0
visuels/baxter.html View File

@@ -0,0 +1,167 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="./d3.v5.min.js"></script>
</head>
<body>
<div class="chart" id="chart1"></div>
<script>
var data={
"name": "Baxter",
"children": [
{
"name": "Variabilité",
"children": [
{"name":"audience", "value": 6},
{"name":"contexte", "value": 6}
]
},
{
"name": "Nature",
"children": [
{"name":"descriptif", "value": 3},
{"name":"narratif", "value": 3},
{"name":"expressif", "value": 3},
{"name":"humoristique", "value": 3}
]
},
{
"name": "Répertoire",
"children": [
{"name":"vocabulaire", "value": 4},
{"name":"grammaire", "value": 4},
{"name":"figures\nde style", "value": 4}
]
},
{
"name": "Niveau\nd'analyse",
"children": [
{"name":"sociopolitiques", "value": 6},
{"name":"psychologiques", "value": 6}
]
}
]
}
partition = data => {
const root = d3.hierarchy(data)
.sum(d => d.value)
.sort((a, b) => b.value - a.value);
return d3.partition()
.size([2 * Math.PI, root.height + 1])
(root);
}

color = d3.scaleOrdinal(d3.quantize(d3.interpolateRainbow, data.children.length + 1))
format = d3.format(",d")
width = 750
radius = width / 6
arc = d3.arc()
.startAngle(d => d.x0)
.endAngle(d => d.x1)
.padAngle(d => Math.min((d.x1 - d.x0) / 2, 0.005))
.padRadius(radius * 1.5)
.innerRadius(d => d.y0 * radius)
.outerRadius(d => Math.max(d.y0 * radius, d.y1 * radius - 1))

function chart(partition,data,d3,width,color,arc,format,radius) {
const root = partition(data);

root.each(d => d.current = d);

var svg = d3.select("#chart1")
.append("svg")
.attr("viewBox", [0, 0, width, width])
.style("font", "10px sans-serif");

const g = svg.append("g")
.attr("transform", `translate(${width / 2},${width / 2})`);

const path = g.append("g")
.selectAll("path")
.data(root.descendants().slice(1))
.join("path")
.attr("fill", d => { while (d.depth > 1) d = d.parent; return color(d.data.name); })
.attr("fill-opacity", d => arcVisible(d.current) ? (d.children ? 0.6 : 0.4) : 0)
.attr("d", d => arc(d.current));

path.filter(d => d.children)
.style("cursor", "pointer")
.on("click", clicked);

path.append("title")
.text(d => `${d.ancestors().map(d => d.data.name).reverse().join("/")}\n${format(d.value)}`);

const label = g.append("g")
.attr("pointer-events", "none")
.attr("text-anchor", "middle")
.style("user-select", "none")
.selectAll("text")
.data(root.descendants().slice(1))
.join("text")
.attr("dy", "0.35em")
.attr("fill-opacity", d => +labelVisible(d.current))
.attr("transform", d => labelTransform(d.current))
.text(d => d.data.name);

const parent = g.append("circle")
.datum(root)
.attr("r", radius)
.attr("fill", "none")
.attr("pointer-events", "all")
.on("click", clicked);

function clicked(p) {
parent.datum(p.parent || root);

root.each(d => d.target = {
x0: Math.max(0, Math.min(1, (d.x0 - p.x0) / (p.x1 - p.x0))) * 2 * Math.PI,
x1: Math.max(0, Math.min(1, (d.x1 - p.x0) / (p.x1 - p.x0))) * 2 * Math.PI,
y0: Math.max(0, d.y0 - p.depth),
y1: Math.max(0, d.y1 - p.depth)
});

const t = g.transition().duration(750);

// Transition the data on all arcs, even the ones that aren’t visible,
// so that if this transition is interrupted, entering arcs will start
// the next transition from the desired position.
path.transition(t)
.tween("data", d => {
const i = d3.interpolate(d.current, d.target);
return t => d.current = i(t);
})
.filter(function(d) {
return +this.getAttribute("fill-opacity") || arcVisible(d.target);
})
.attr("fill-opacity", d => arcVisible(d.target) ? (d.children ? 0.6 : 0.4) : 0)
.attrTween("d", d => () => arc(d.current));

label.filter(function(d) {
return +this.getAttribute("fill-opacity") || labelVisible(d.target);
}).transition(t)
.attr("fill-opacity", d => +labelVisible(d.target))
.attrTween("transform", d => () => labelTransform(d.current));
}
function arcVisible(d) {
return d.y1 <= 3 && d.y0 >= 1 && d.x1 > d.x0;
}

function labelVisible(d) {
return d.y1 <= 3 && d.y0 >= 1 && (d.y1 - d.y0) * (d.x1 - d.x0) > 0.03;
}

function labelTransform(d) {
const x = (d.x0 + d.x1) / 2 * 180 / Math.PI;
const y = (d.y0 + d.y1) / 2 * radius;
return `rotate(${x - 90}) translate(${y},0) rotate(${x < 180 ? 0 : 180})`;
}
console.log("SVG créé")

return 0;
}

mysvg = chart(partition,data,d3,width,color,arc,format,radius);
</script>
</body>

+ 2
- 0
visuels/d3.v5.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save