1/* 2 Todo: Replace google maps implementation with mapbox for visual consistency 3*/ 4 5import { Controller } from "@hotwired/stimulus" 6 7// Connects to data-controller="numiko--international-law" 8export default class extends Controller { 9 connect () { 10 const script = document.createElement('script'); 11 script.onload = function () { 12 google.load('visualization', '1', { packages: ['geochart'] }); 13 14 function drawVisualization() { 15 const data = google.visualization.arrayToDataTable([ 16 ['Country', 'Ratification date'], 17 ['Argentina', 2000], 18 ['Bolivia', 1991], 19 ['Brazil', 2002], 20 ['Central African Republic', 2010], 21 ['Chile', 2008], 22 ['Colombia', 1991], 23 ['Costa Rica', 1993], 24 ['Denmark', 1996], 25 ['Dominica', 2002], 26 ['Ecuador', 1998], 27 ['Fiji', 1998], 28 ['Germany', 2021], 29 ['Guatemala', 1996], 30 ['Honduras', 1995], 31 ['México', 1990], 32 ['Nepal', 2007], 33 ['Netherlands', 1998], 34 ['Nicaragua', 2010], 35 ['Norway', 1990], 36 ['Paraguay', 1993], 37 ['Peru', 1994], 38 ['Spain', 2007], 39 ['Venezuela', 2002] 40 ]); 41 42 const geochart = new google.visualization.GeoChart(document.getElementById('visualization')); 43 geochart.draw(data, { 44 colorAxis: { 45 colors: ['#c5663b', '#017352'] 46 }, 47 legend: { numberFormat: '####' } 48 }); 49 } 50 google.setOnLoadCallback(drawVisualization); 51 }; 52 script.src = 'https://www.google.com/jsapi'; 53 document.head.appendChild(script); 54 } 55}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.