Published
Edited
Jul 24, 2020
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
spreadFactor = match == "Liverpool [2] - 1 Newcastle" ? 5 : 3;
Insert cell
widthA = MZ.length*spreadFactor+marginA.left+marginA.right
Insert cell
heightA = MZ[0].length*50+marginA.top+marginA.bottom
Insert cell
marginA = ({left: 25, right: 25, top: 25, bottom: 50})
Insert cell
dataMatch = rawData.filter(object => object.play == match)
Insert cell
getFrame = (dataMatch, n_frame) => {
let temp = [...dataMatch.filter(object => parseFloat(object.frame) == n_frame)];
temp.forEach((A, i) => {
let B = Object.assign({}, A);
B.y = 100 - B.y;
B.dy = -B.dy;
temp[i] = B;
})
return temp;
}
Insert cell
frame = getFrame(dataMatch, n_frame)
Insert cell
Agents = frameToAgent(frame);
Insert cell
rawData = d3.csv("https://raw.githubusercontent.com/Friends-of-Tracking-Data-FoTD/Last-Row/master/datasets/positional_data/liverpool_2019.csv");
Insert cell
d3 = require('d3', 'd3-polygon')
Insert cell
textures = require('textures@1.2.0/dist/textures.js')
Insert cell
embed = require("vega-embed@6")
Insert cell
import {multipleZones2, getNodes, timeNodes, drawZone, barycenter} from '@julesallegre/conflict-zone-model'
Insert cell
import {frameToAgent, innerSize, width, height} from '@julesallegre/conflict-zone-model-soccer-application'
Insert cell
import {drawfield, drawPlayer, margin, addSpeedPlayer, line, xReal, yReal, closer, posX, posY} from '@julesallegre/liverpool-goal-2019'
Insert cell
import {checkbox, select} from "@jashkenas/inputs";
Insert cell
import {Scrubber} from "@mbostock/scrubber"
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more