Visualizations Showcase
Preamble
Preamble
from plotapi import PieFight
import json
PieFight.set_license("your username", "your license key")
Introduction
In this notebook we're going to use PlotAPI ieBar Fight to visualise desktop browser market share over time. We"ll use Python, but PlotAPI can be used from any programming language.
Dataset
Work in progress.
import pandas as pd
data = pd.read_csv('desktop_browsers.csv')
#data.to_dict('records')
data = pd.melt(data, id_vars='Date')
data.columns=['order','name','value']
data['order'] = data['order'].str.replace('-','.')
samples = data.to_dict('records')
data['name'].unique()
array(['Chrome', 'IE', 'Firefox', 'Safari', 'Opera', 'Edge Legacy', 'Edge', 'Netscape', 'Mosaic', 'Others'], dtype=object)
nodes = [
{
"name": "Chrome",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/chrome.png",
"color": "#4285F4"
},
{
"name": "IE",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/ie.png",
"color": "#FFB937"
},
{
"name": "Firefox",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/firefox.png",
"color": "#7543E3"
},
{
"name": "Safari",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/safari.png",
"color": "#CCCCCC"
},
{
"name": "Opera",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/opera.png",
"color": "#CC0011"
},
{
"name": "Edge",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/edge.png",
"color": "#65C465"
},
{
"name": "Edge Legacy",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/edge_legacy.png",
"color": "#00D1D1"
},
{
"name": "Netscape",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/netscape.png",
"color": "#357984"
},
{
"name": "Mosaic",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/mosaic.png",
"color": "#9185A9"
},
{
"name": "Others",
"icon": "https://datacrayon.com/images/data-is-beautiful/desktop-browsers/others.png",
"color": "gray"
},
]
events = [
{
"order": 1994.01,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/mosaic.png"><br>NCSA Mosaic (Jan 1993) was one of the first web browsers, and instrumental in popularizing the World Wide Web.''',
},
{
"order": 1994.12,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/netscape.png"><br>Netscape Navigator (Dec 1994) quickly became the de facto standard. During development, it was known by the code name <em>Mozilla</em>''',
},
{
"order": 1995.09,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/ie.png"><br>Internet Explorer (Aug 1995) gained popularity after being bundled with Microsoft Plus! and later versions of Windows 95.''',
},
{
"order": 1996.12,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/opera.png"><br>Opera (Apr 1996) has its first public release as shareware. It has low usage share amongst other desktop browsers.''',
},
{
"order": 1998.09,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/ie.png"><br>IE overtakes (Sep 1998) and continues to <em>"cut off Netscape's air supply"</em>. The United States v. Microsoft Corp antitrust suit begins.''',
},
{
"order": 2002.06,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/firefox.png"><br>Firefox (Sep 2002) was initially released under the code name <em>Phoenix</em> (rising from the ashes of its dead predecessor, Netscape Navigator).''',
},
{
"order": 2003.06,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/safari.png"><br>Safari (Jan 2003) is released for Mac. It had a few names during development: <em>Freedom</em>, <em>Alexander</em>, and <em>iBrowse</em>.''',
},
{
"order": 2008.09,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/chrome.png"><br>Google Chrome (Sep 2008) has its beta release and quickly gains around 1% usage share. Originally based on Apple WebKit, later forked to create Blink.''',
},
{
"order": 2009.08,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/firefox.png"><br>Firefox usage share grew to a peak (2009) and overtakes IE 7 (but not all versions as a whole). Usage starts to decline in competition with Chrome.''',
},
{
"order": 2015.07,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/edge_legacy.png"><br>Microsoft Edge <em>Legacy</em> (Apr-Aug 2015) is released with proprietary browser engine EdgeHTML and Chakra JS engine. Its code name was <em>Spartan</em>.''',
},
{
"order": 2020.02,
"event": '''<img src="https://datacrayon.com/images/data-is-beautiful/desktop-browsers/edge.png"><br>Microsoft Edge (Jan 2020) is released, now based on Chromium with Blink and V8 engines. It replaces Edge Legacy and eats its usage share.''',
}
]
import json
data = {"samples": samples,
"nodes": nodes,
"events": events}
with open("desktop_browsers.json", "w") as fp:
json.dump(data, fp)
Visualisation
Let's use PlotAPI Pie Fight for this visualisation, you can see more examples in the Gallery.
PieFight(samples,
event_pause=False,
interval=750,
event_duration=10000,
rotate=30,
nodes=nodes,
events=events,
format_current_order="0.2f",
value_suffix="%",
autohide_labels=False).to_html()