Connect with us

Uncategorized

Desktop Browsers Market Share With Plotapi Pie Fight

Published

on

Preamble?

In [1]:

from plotapi import PieFight
import json

PieFight.set_license(“your username”, “your license key”)

Introduction?

In this notebook we’re going to use Plotapi Pie Fight to visualise desktop browser market share over time. We”ll use Python, but Plotapi can be used from any programming language.

Dataset?

We’re going to use data that has been published by multiple sources for different periods, as there is no single data source that covers everything. These are:

1994 – 1995: GVU WWW user survey
1996 – 1998: EWS Web Server at UIUC
1999 – 2001: WebSideStory
2002 – 2008: OneStat.com
2009-2021: StatCounter

The popup text that describes different events was taken from Wikipedia.
Browsers that did not have significant market share have been grouped and labelled as “Others”.

In [2]:

with open(“desktop_browsers.json”, “r”) as f:
data = json.load(f)

samples = data[‘samples’]
nodes = data[‘nodes’]
events = data[‘events’]

Visualisation?

Let’s use Plotapi Pie Fight for this visualisation, you can see more examples in the Gallery.

In [5]:

PieFight(samples,
nodes=nodes,
events=events,
rotate=30,
interval=750,
event_pause=False,
event_duration=10000,
format_current_order=”0.2f”,
value_suffix=”%”,
autohide_labels=False).show()

Plotapi – Pie Fight Diagram


);
});

d3.select(“#plotapi-chart-5b0809de_svg div.box”)
.style(“–s”,side+”px”)
.style(“–p”,”5px”)

d3.select(“#plotapi-chart-5b0809de_svg .event_group”)
.interrupt()
.transition()
.duration(250)
.style(“opacity”, 1)
d3.select(“#plotapi-chart-5b0809de_svg .event_group”)
.transition()
.delay(element.duration ? element.duration : 10000)
.duration(250)
.style(“opacity”, 0)
;
}

function update_current(current) {
var event_fired = false;
var new_contestant = false;

var event_element = events.find(item => {
return item.order === current
})

if(event_element != undefined){
event_fired = true;
show_event(event_element)
}

current_data = data.filter((d) => d.order == current);

for (var index = 0; index d.id == element.id);
if (contestant.length != 0) {
if (!isNaN(element.value)) {
contestant[0].current_value = contestant[0].target_value;
contestant[0].target_value = element.value;
contestant[0].travel_scale = d3
.scaleLinear()
.domain([0, 750.0])
.range([contestant[0].current_value, element.value]);
}
} else {
new_contestant = true;
var target_value = !isNaN(element.value) ? element.value : 0;

contestant_icon_image = icon(element.id);

contestant = {
id: element.id,
color: color(element.id),
icon_href: contestant_icon_image,
current_value: target_value,
target_value: target_value,
travel_scale: d3
.scaleLinear()
.domain([0, 750.0])
.range([target_value, target_value]),
};

contestants.push(contestant);
}
}

if(new_contestant){
var current_contestants;
current_contestants = contestants.filter((d) => d.current_value > 0);

arcs = pie(current_contestants);

pie_group.selectAll(“path.outer-arc”)
.data(arcs)
.join(“path”)
.attr(“fill”, d => darken_color(d.data.color, -0.5))
.attr(“class”, “outer-arc”)
.attr(“d”, outer_arc);

pie_group.selectAll(“path.inner-arc”)
.data(arcs)
.join(“path”)
.attr(“fill”, d => d.data.color)
.attr(“class”, “inner-arc”)
.attr(“d”, inner_arc);

pie_group.selectAll(“text”)
.data(arcs)
.join(“text”)
.attr(‘dy’, ‘.35em’)
.attr(“fill”, d => darken_color(d.data.color, 1))
.attr(“d”, outer_arc)
.attr(“class”, “label_text”)
.html(d => (midAngle(d)) > Math.PI ?
unique_names[d.data.id]
+ ” – ” +
” + format_value(d.data.current_value) + “%”
:
” + format_value(d.data.current_value) + “%”
+ ” – ” +
unique_names[d.data.id]
)
.attr(‘transform’, labelTransform)
.style(‘text-anchor’, function (d) {

return (midAngle(d)) darken_color(d.data.color, 1))
;

if (contestant_icon_image) {
pie_group.selectAll(“image”)
.data(arcs)
.join(“image”)
.attr(“width”, function (d) {
d.icon_size =d3.min([((((d.endAngle – d.startAngle) / (Math.PI)) * radius)*0.96)*2, icon_size]);
d.icon_size = d3.max([d.icon_size, 1]);
return d.icon_size
})
.attr(“height”, d => d.icon_size)
.attr(“xlink:href”, d => d.data.icon_href)
.attr(“d”, outer_arc)
.attr(“transform”, d => ‘translate(‘+text_arc.centroid(d)+’)’)
.attr(“x”, d => -(d.icon_size / 2))
.attr(“y”, d => -(d.icon_size / 2))
}
}

if (sequence_index > 0) {
update_minimap();
}
}

function force_order(easeFn) {
icon_size = d3.max([(radius*0.3) – (icon_padding * 2), 0]);
}

function draw(delta) {
for (var index = 0; index d.current_value);

if (new_max != current_max) {
current_max = new_max;
}
}
}

var current_contestants;
current_contestants = contestants.filter((d) => d.current_value > 0);

arcs = pie(current_contestants);

pie_group.selectAll(“path.outer-arc”)
.data(arcs)
.join(“path”)
.attr(“fill”, d => darken_color(d.data.color, -0.5))
.attr(“class”, “outer-arc”)
.attr(“d”, outer_arc);

pie_group.selectAll(“path.inner-arc”)
.data(arcs)
.join(“path”)
.attr(“fill”, d => d.data.color)
.attr(“class”, “inner-arc”)
.attr(“d”, inner_arc);

pie_group.selectAll(“text”)
.data(arcs)
.join(“text”)
.attr(‘dy’, ‘.35em’)
.attr(“fill”, d => darken_color(d.data.color, 1))
.attr(“d”, outer_arc)
.attr(“class”,”label_text”)
.html(d => (midAngle(d)) > Math.PI ?
unique_names[d.data.id]
+ ” – ” +
” + format_value(d.data.current_value) + “%”
:
” + format_value(d.data.current_value) + “%”
+ ” – ” +
unique_names[d.data.id]
)
.attr(‘transform’, labelTransform)
.style(‘text-anchor’, function (d) {

return (midAngle(d)) darken_color(d.data.color, 1))
;

pie_group.selectAll(“image”)
.data(arcs)
.join(“image”)
.attr(“width”, function (d) {
d.icon_size =d3.min([((((d.endAngle – d.startAngle) / (Math.PI)) * radius)*0.96)*2, icon_size]);
d.icon_size = d3.max([d.icon_size, 1]);
return d.icon_size
})
.attr(“height”, d => d.icon_size)
.attr(“xlink:href”, d => d.data.icon_href)
.attr(“d”, outer_arc)
.attr(“transform”, d => ‘translate(‘+text_arc.centroid(d)+’)’)
.attr(“x”, d => -(d.icon_size / 2))
.attr(“y”, d => -(d.icon_size / 2))

}

function initialise() {
contestants = [];
d3.select(“#plotapi-chart-5b0809de_svg .minimap_group”)
.selectAll(“*”)
.remove();
last_proc = 0;
top_n = 10;
icon_padding =1;
text_padding = 5;
current_order = [];
last_order = [];
elapsed_time = 0;
sequence_index = 0;
current_max = null;
icon_size = d3.max([(radius*0.3) – (icon_padding * 2), 0]);

pie = d3.pie()
.padAngle(0.02)
.sort(function (a, b) {
return unique_names[b.id]
.localeCompare(unique_names[a.id]);
})
.value(d => d.current_value)

update_current(sequence_index);

current_order_text.text(format_current_order(sequence[sequence_index]))

new_max = d3.max(contestants, (d) => d.current_value);

if (new_max != current_max) {
current_max = new_max;
}

force_order(d3.easeCubic);
}

function darken_color(color, factor) {
return d3.color(color).darker(factor)
}

function color(index) {
node = nodes[index];
if (node.color) {
return node.color;
}

var ratio = index / (10);
return d3.interpolateRainbow(ratio);
}

function icon(index) {
node = nodes[index];
if (node.icon) {
return node.icon;
}

return ” “;
}

function update_minimap() {
var minimap_order = contestants.slice();
minimap_order.sort((a, b) => b.target_value – a.target_value);
minimap_order = minimap_order.slice(0,10);

current_sum = minimap_order
.map((item) => item.current_value)
.reduce((prev, next) => prev + next);

if (current_sum != 0) {
var mm_bar_height = 47.0;
var mm_bar_drop_height = 141.0;

mm_y_scale = d3
.scaleLinear()
.domain([0, current_sum])
.range([0, mm_bar_height]);
mm_x_scale = d3
.scaleLinear()
.domain([0, sequence.length])
.range([0, 260.0]);

var mm_pos_x = mm_x_scale(sequence_index – 1);
var mm_width = mm_x_scale(1);

var mm_running_total = 0;
for (
var mm_index = 0; mm_indexRead More

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Uncategorized

You Recovered From COVID-19…now What?

Published

on


In 2020, we were focused on prevention, by boosting our immune system and following other guidelines to limit potential exposure, and early intervention for COVID- 19. We have continued to update our immune boosting strategies, but the foundation has stayed the same. Everyone should be on Vitamin D3, Vitamin C, and Zinc. Other supplements and treatments are on the list which is readily available at our office.

As we end 2020 and head into 2021, our goal is to help restore energy and well-being in those who were previously infected and are processing back to normal . Some patients are reporting varying degrees of insomnia, chronic fatigue, depression, and lingering respiratory symptoms, and other symptoms that some in the medical field have referred to as the “Covid-19 Long Haul Syndrome”. As I research new information on COVID – these appear to be common all over the world.

The good news is that SEASONS WELLNESS has many unique resources to help overcome some of these symptoms. Whether you are a patient here or have a friend experiencing post-Covid exhaustion, etc., we would love to offer you some strategies that may help in your journey.

Seasons has a new inclusive package which includes a brief office visit along with a series of four vitamin IV treatments and Glutathione to boost immunity and improve energy levels.

In addition, we may also recommend a personalized precision test through urine for mitochondrial energy/detoxification issues/deficiencies in glutathione and Vitamin C as well as gut health. Your test results will be explained at a follow up visit with specific treatment plan recommendation.

Whether you are in the prevention stage, early infection stage, or post Covid stage there are so many things you can do to improve your health! Give us a call today for more information. Our resolution for 2021 is to live better – not just stay alive.

New to Seasons? Contact us to schedule a complimentary consultation today by clicking HERE

Nan Sprouse, FNP-BC, FAAMM

The post You Recovered from COVID-19…now what? appeared first on Seasons Wellness.

Read More

Continue Reading

Uncategorized

Motorola Moto G Power 2022 Full Specifications and Price

Published

on

Here are the full specifications of the Motorola Moto G Power 2022 smartphone device and the price you need to know before buying one with your money or on credit.

Also, See:

Phone Details

Motorola Moto G Power 2022 Full Specifications

General

BrandMotorolaModelMoto G Power 2022DisplayIPS LCD, 90HzBody typeGlass front, plastic back, plastic frameProtectionScratch Resistant GlassDimensions167.2 x 76.5 x 9.4 mmWeight203 gBattery capacityLi-Po 5000 mAh, non-removableFast chargingYes, 10WWireless chargingNoUptimeN/AColour variantsBlackReleased yearNovember 2021

Display

Screen size6.5 inchesResolution720 x 1600 pixels at 270 PPI densityAspect ratio20:9 ratio

Hardware

ProcessorMediaTek Helio G37 chipsetRAM4GBInternal storage64GB, 128GB, MicroSD expandableMicroSD LimitNot Specified

Camera

Rear cameraTriple Lens, 50 MP camera at f/1.8 aperture, 2 MP at f/2.4 and 2 MP at f/2.4 with LED flash and HDRFront cameraSingle Lens, 8 MP camera at f/2.0 apertureCamera functionsN/A

Software

OSAndroid 11SkinN/A

Connectivity

Wi-FiYesGPSYesBluetoothYesNFCNoUSB typeUSB Type-C 2.0SIM typeDual, Nano-SIMsGSM/CDMAGSM2GYes2G bandsGSM 850 / 900 / 1800 / 19003GYes3G bandsHSDPA 850 / 900 / 1700(AWS) / 1900 / 21004G/ LTEYes4G bandsLTE5GNoSpeedHSPA 42.2/5.76 Mbps, LTE

Sensors

FingerprintYes, side-mountedProximityYesBarometerYesAccelerometerYesGyroscopeYesCompassYesOthersFace ID

Sound

LoudspeakerYes3.5mm jackYes

MISC

Also in the boxCharging Adapter, USB Cable and User Manual

Also, See:

Motorola Moto G Power 2022 Price

Motorola Moto G Power 2022 is priced at around $205 in the United States, €180 in Europe and ₦83,500 in Nigeria. Prices in other specific countries and currencies are provided below.

United States$205United Kingdom£150Europe€180China¥1,299India₹15,099Nigeria₦83,500GhanaGh₵1,245South AfricaZAR3,199KenyaKsh22,769Read More

Continue Reading

Trending

Merablue.com