Skip to content

Instantly share code, notes, and snippets.

View nyurik's full-sized avatar

Yuri Astrakhan nyurik

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nyurik on github.
  • I am nyurik (https://keybase.io/nyurik) on keybase.
  • I have a public key ASA_DNz0UNVjjeDMAIOHOLYL2y2ybFNWIMgB9dkX5A5j3Qo

To claim this, I am signing this object:

{
$schema: https://vega.github.io/schema/vega/v3.json
padding: 10
config: {
kibana: {tooltips: false}
}
signals: [
{
name: rotation
value: 65
@nyurik
nyurik / rotating_world_map.hjson
Created November 13, 2018 19:32
Kibana rotating cloropleth world map
{
$schema: https://vega.github.io/schema/vega/v3.json
padding: 10
config: {
kibana: {tooltips: false}
}
signals: [
{
name: rotation
value: 65
@nyurik
nyurik / vega_img.json
Created July 10, 2018 15:49
vega with conditional image (centered and stretched to the largest size preserving aspect ration)
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"width": 200,
"height": 200,
"padding": 5,
"marks": [
{
"type": "image",
"encode": {
"enter": {
{
$schema: https://vega.github.io/schema/vega/v3.0.json
config: {
kibana: {type: "map", latitude: 25, longitude: -70, zoom: 3}
}
data: [
{
name: table
url: {
index: kibana_sample_data_flights
@nyurik
nyurik / webinar-earthquakes.json
Created February 22, 2018 21:29
Vega Webinar - copy of standard example with absolute URLs
// Copied from https://vega.github.io/vega/examples/earthquakes/
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"signals": [
{"name": "quakeSize", "value": 6},
{
"name": "rotate0",
"value": 90,
"bind": {"input": "range", "min": -180, "max": 180}
@nyurik
nyurik / webinar-demo2.hjson
Created February 22, 2018 21:24
Vega Webinar - area chart from multivariable composite aggregation
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
url: {
index: logstash-*
%context%: true
%timefield%: @timestamp
body: {
size: 0
aggs: {
@nyurik
nyurik / webinar-demo1.hjson
Last active February 22, 2018 21:23
Vega Webinar - scatter plot showing web requests for various file types
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
// Get 10000 documents from ES
url: {
%context%: true
%timefield%: @timestamp
index: logstash-*
body: {
@nyurik
nyurik / eu_subreg.sparql
Created December 8, 2017 07:38
All european sub-regions with their languages
SELECT
?id
# remove possible duplicates
(SAMPLE(?iso_3166_2) as ?iso_3166_2)
(SAMPLE(?insee_fr) as ?insee_fr)
(SAMPLE(?flagImg) as ?flagImg)
# all of the official languages in the European Union
(SAMPLE(?label_bg) as ?label_bg)
(SAMPLE(?label_cs) as ?label_cs)
@nyurik
nyurik / subregions.sparql
Created December 8, 2017 05:18
Query to get subregions of a given region/country from Wikidata
# Use group-by to ensure only a single ID is present (otherwise the geo service will error)
SELECT
?id
(SAMPLE(?label_en) as ?label_en)
(SAMPLE(?label_zh) as ?label_zh)
(SAMPLE(?label_fr) as ?label_fr)
(SAMPLE(?label_de) as ?label_de)
(SAMPLE(?iso_3166_2) as ?iso_3166_2)
(SAMPLE(?insee_fr) as ?insee_fr)