Github Gist and Bl.ocks
Category : Javascript Tag : d3.js 101series
Dec. 11, 2020, 5:18 p.m.

Short Description :
Explain how to use github gist and quick rendering d3.js from the page
source : tak, bl.cks

<h3>What is GitHub Gist</h3><p><b><a href="https://gist.github.com/" target="_blank" style="background-color: rgb(255, 255, 255);">GitHub Gist</a>&nbsp;</b>is an easy way to share your code snippets or data with others through web page. A git will accept any types of data such as a string of code, shell script, or data (ie json, csv, etc.). It is hosted by github</p><p><br></p><h3>What is a difference between github and github gist?</h3><p><b>Github</b> includes entire site of your github account, while <b>gitsts </b>are specific service provided by github focusing on "gist" of code. According to <a href="https://docs.github.com/en/enterprise/2.13/user/articles/about-gists" target="_blank">github help</a>, gist inherits basic git capability</p><blockquote><p style="margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, system-ui, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 16px;">Every gist is a Git repository, which means that it can be forked and cloned. The gist editor is powered by&nbsp;<a href="https://codemirror.net/" style="color: rgb(3, 102, 214);">CodeMirror</a>.</p></blockquote><p><br></p><h3>How to use a gist</h3><p style="line-height: 2;">URL is similar to github, if your github page is;</p><p style="line-height: 2;">&nbsp;&nbsp;&nbsp;&nbsp;<i>github.com/&lt;your account name&gt;</i></p><p>then your gist page can be accessed by;</p><p style="line-height: 2;">&nbsp;&nbsp;&nbsp;&nbsp;<i>gist.github.com/&lt;your account name&gt;</i></p><p>Once you are at your gist page, it's very easy to use. Push plus mark at right side of top navigation bar, then you will see below screen. What you do is to put few description, file name and its content. If you need more file, push "add file" button at the bottom and repeat. Your specific gist project page can be either secret for private use (hidden by search engine unless they know the URL), or public use, which can be selected at right bottom green button.</p><p><img src="/media/django-summernote/2020-12-11/f76a778d-d1a8-4df9-8d6e-fe7e9cf65e8c.png" style="width: 100%;"></p><p>final gist pages after creation is something like below</p><p><img src="/media/django-summernote/2020-12-11/efd2f22a-5a20-4674-8b42-4f36f8b952ac.png" style="width: 100%;"></p><p><br></p><h3>bl.ocks.org Intro</h3><p>Gist itself is already helpful, but&nbsp;<a href="https://bl.ocks.org/" target="_blank"><b>bl.ocks.org</b></a> provides further capability using your gist page - visualize your code. Bl.ocks is originally built to render d3 and you will see popular blocks in the site.</p><p><img src="/media/django-summernote/2020-12-11/eabd9f1b-f39b-4cc4-ba42-ca4c5d47c072.png" style="width: 100%;"></p><p><br></p><h3>How to use bl.ocks</h3><p>It's quite easy, if your gist page is something like;</p><p>&nbsp;&nbsp;&nbsp;<i>&nbsp;</i><a href="https://gist.github.com/Tak113/4a8caf75e1d3aa13132c8ad9a662a49b" target="_blank">https://gist.github.com/Tak113/4a8caf75e1d3aa13132c8ad9a662a49b</a></p><p>bl.ocks page is;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://bl.ocks.org/Tak113/4a8caf75e1d3aa13132c8ad9a662a49b" target="_blank">https://bl.ocks.org/Tak113/4a8caf75e1d3aa13132c8ad9a662a49b</a></p><p style="line-height: 1;">just replacing "gist.github.com" with "bl.ocks.org".</p><p style="line-height: 1;"><br></p><p style="line-height: 1;">For a convenient access, they offer browser extension on this. In the case, just push "bl.ocks" button at right side and that's it.</p><p style="line-height: 1;"><img src="/media/django-summernote/2020-12-11/2271bc68-c60e-4509-928c-62dc4b3e4ab3.png" style="width: 100%;"><br></p><p style="line-height: 1;"><br></p><p style="line-height: 1;">Now you see a visualization from your gist page. Below is my example from d3 topojson (<a href="https://bl.ocks.org/Tak113/4a8caf75e1d3aa13132c8ad9a662a49b" target="_blank">link</a>)</p><p style="line-height: 1;"><img src="/media/django-summernote/2020-12-11/dffaa9c2-b7ed-45dd-8294-518b21dc09c0.png" style="width: 1065px;"><br></p>


<< Back to Blog Posts
Back to Home

Related Posts

d3 v6 world map
Dec 7 2020
how to mash up v6 based topojson, tooltip, and blinking dot to show a certain city using world map
Real time d3.js visualization using github API
Dec 7 2020
test
Git 101 : Github Basics Pt1
Nov 28 2020
Basic commands for git operations, such as add/commit to repo, change/merge branch etc.
Static web at Github Pages
Dec 14 2020
How to deploy static web pages at github.io pages
Git 101 : Github Basics Pt2
Jan 11 2021
This is pt 2 of github 101, focusing on branch and other miscellaneous but helpfull operations



© DATAK 2024