Skip to content

Instantly share code, notes, and snippets.

@aaizemberg
Created April 28, 2020 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaizemberg/9c69a296702147dbf4b0ff03ff18f121 to your computer and use it in GitHub Desktop.
Save aaizemberg/9c69a296702147dbf4b0ff03ff18f121 to your computer and use it in GitHub Desktop.
1. read.tsv, 2. lodash processing, 3. Apache ECharts (Actividad)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>1. read.tsv, 2. lodash processing, 3. Apache ECharts</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<h1>Actividad</h1>
<ol>
<li>read.tsv</li>
<li>_lodash processing</li>
<li>Apache ECharts</li>
</ol>
<div id="aca_deberia_estar_el_grafico_generado_por_ECharts"></div>
<script>
// reemplazar estos datos, por los datos de verdad
//
var data = [
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Industrial' },
{c :'Ing Informatica' },
{c :'Ing Informatica' },
{c :'Ing Informatica' },
{c :'Ing Informatica' },
{c :'Ing Informatica' },
{c :'Ing Informatica' }
];
// usamos lodash para hacer un countBy 'c'
//
var result = _.countBy(data, 'c');
console.log(result);
// hacer un grafico con Apache ECharts
// ...
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment