Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ggplot.galleryというお遊びウェブアプリケーションを作った話

 ggplot.galleryというお遊びウェブアプリケーションを作った話

Atsushi Takayama

July 10, 2017
Tweet

More Decks by Atsushi Takayama

Other Decks in Technology

Transcript

  1. ggplot.galleryͱ͍͏
    ͓༡ͼ΢ΣϒΞϓϦέʔγϣϯΛ࡞ͬͨ࿩
    fukuoka.R #08 (ฏ೔൛)

    View full-size slide

  2. ࣗݾ঺հ
    • ߴࢁԹ @edvakf
    • ϐΫγϒCTO݉෱ԬΦϑΟε্ཱͪ͛୲౰
    • େֶӃ࣌୅͸౷ܭ෺ཧͰɺMatLabΛ࢖ͬͯ·ͨ͠
    • R͸ͪΐͬͱ࢖ͬͨهԱ͕͋Δ…
    • ࢓ࣄͰ͸ओʹ΢ΣϒΞϓϦέʔγϣϯΤϯδχΞ

    View full-size slide

  3. ggplotͱ͸
    • ϓϩοτΛඳ͘RͷϥΠϒϥϦ
    • The Grammer of Graphicsͱ͍͏ຊͷମܥʹج͍ͮͨ
    API
    • ៉ྷͳϓϩοτ͕Ͱ͖Δ
    • ͱʹ͔͘៉ྷʂ

    View full-size slide

  4. ྫɿώετάϥϜ

    View full-size slide

  5. ൺֱɿmatplotlib
    pythonͰղੳͷίʔυॻ͍ͯͯ΋ɺϓϩοτ͚ͩ͸ggplotͰ΍Γͨ͘ͳͬͯ͘Δ…

    View full-size slide

  6. ॻ͖ํ
    library(ggplot2)
    library(reshape2)
    df <- read.table("random", header = TRUE)
    df <- melt(df)
    plt <- ggplot(df, aes(x=value, fill=variable))
    plt <- plt +
    geom_histogram(alpha=0.5, position="identity")
    plot()

    View full-size slide

  7. Πέͯͳ͍ͱ͜Ζ
    • υΩϡϝϯτʹαϯϓϧίʔυ͕͋Δͷ͸ྑ͍͕ɺσʔ
    λ͕ແ͍ͷͰؾܰʹࢼͯ͠ΈΔ͜ͱ͕Ͱ͖ͳ͍
    • http://docs.ggplot2.org/current/
    • ͦ΋ͦ΋R͕ͭΒ͍
    • "<-" Λॻ͘ͷ͕໘౗͍͘͞

    View full-size slide

  8. ggplot.galleryͳΒ
    • ϓϩοτʹϑΝΠϧΛఴ෇Ͱ͖Δ
    • ίʔυ͸͋Δ͚Ͳσʔλ͕ແ͍͔Β࣮ߦͰ͖ͳ͍ͱ͍
    ͏͜ͱ͕ͳ͍
    • ಈ͘αϯϓϧΛϑΥʔΫͯ͠ࢼߦࡨޡ͠ͳ͕Β޷Έͷϓ
    ϩοτΛ࡞ΕΔ

    View full-size slide

  9. ͞Βʹ
    • ϓϩοτʹը૾ͷURL͕༩͑ΒΕΔͷͰɺνϟοτʹష
    Γ෇͚΍͍͢
    • SVG, PNG
    • highchairsͳͲͰ͸ແཧ
    • API͕ॆ࣮
    • ೔ʑͷKPIΛbot͕νϟοτʹషΔ༻్ͳͲΛ૝ఆ

    View full-size slide

  10. RubyͰσʔλ࡞ͬͯggplot.galleryʹ౤͛ͯը૾URLΛSlackʹ౤͛ͯ·͢

    View full-size slide

  11. ggplot.galleryΛࢧ͑Δٕज़
    • go
    • Docker
    • ೚ҙͷRͷίʔυΛ࣮ߦͰ͖ΔͷͰαϯυϘοΫεԽ
    • docker run —net=none Ͱ֎෦ΞΫηεΛېࢭ
    • nginx
    • ը૾ͷΩϟογϡͳͲ
    • ansible
    • ηοτΞοϓͱσϓϩΠ

    View full-size slide

  12. Fork me on GitHub
    • http://ggplot.gallery/
    • https://github.com/edvakf/ggallery

    View full-size slide

  13. ࠂ஌ɿpixiv Night #05 Πϥετͷػցֶशٕज़
    ෱Ԭதܧ΋ϐΫγϒΦϑΟεͰ΍Γ·͢ʢΠϕϯτϖʔδ͸·ͩ…ʣ

    View full-size slide