Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Software & Technology
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions


Reply
 
Thread Tools Display Modes
  #241  
Old 05-09-2017, 11:42 AM
campbell's Avatar
campbell campbell is offline
Mary Pat Campbell
SOA AAA
 
Join Date: Nov 2003
Location: NY
Studying for duolingo and coursera
Favorite beer: Murphy's Irish Stout
Posts: 77,671
Blog Entries: 6
Default

Check out the source code:

Code:
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>


    <script>
        var color = d3.scale.linear().range(["#156b87", "purple"]);
        var size = 1000;

        var pack = d3.layout.pack()
            .sort(null)
            .size([size, size - 100])
            .value(function (d) { return d.Count_AnimalName * 10; })
            .padding(2);

        var svg = d3.select("#chart").append("svg")
            .attr("width", size)
            .attr("height", size)
            .style("display", "block")
            .style("margin", "auto");

        d3.csv("https://raw.githubusercontent.com/Kaz-A/dog_names/master/dogNames2.csv", ready);

        function ready(error, data) {
            if (error) throw error;
            console.log(data);
            data.forEach(function (d) {
                d.Count_AnimalName = +d.Count_AnimalName;
            });

            color.domain(d3.extent(data, function (d) { return d.Count_AnimalName; }));

            var circles = svg.selectAll("circle")
                .data(pack.nodes({ children: data }).slice(1))
                .enter().append("circle")
                .attr("class", "circle")
                .attr("r", function (d) { return d.r; })
                .attr("cx", function (d) { return d.x; })
                .attr("cy", function (d) { return d.y; })
                .style("fill", function (d) { return color(d.Count_AnimalName); })
                .on("mouseover", function (d) {
                    d3.select("#text").html("<h2>" + d.Row_Labels + "</h2><br /><h4>" + d.Count_AnimalName + " dog names</h4>");
                })
                .on("mouseout", function (d) {
                    d3.select("#text").html("");
                });

            // search
            d3.select("#userInput").on("keyup", search);
            function search(value, d) {
                var input = this.value.toUpperCase();
                var name = d.Row_Labels;
                var name = input;
                console.log(name);
                // get the count for user-input name
                var nameObj = data.filter(function (d) { return d.Row_Labels == input });
                console.log(nameObj);
                var count = nameObj[0].Count_AnimalName;
                console.log(count);
                circles.classed("circle-hover", function (d) { return name == d.Row_Labels; });
                var subtext = d3.select("#text").html("<h2>" + name + "</h2><br />");
                subtext.append("h4")
                    .text(name == "" ? "" : count + " dog names");
            };

            function unsearch(d) {
                circles.classed("circle-hover", false);
                d3.select("#text").html("");
            };

        };

        d3.select(self.frameElement).style("height", size + "px");

    </script>
background:

https://en.wikipedia.org/wiki/D3.js
__________________
It's STUMP

LinkedIn Profile
Reply With Quote
  #242  
Old 05-09-2017, 12:53 PM
clarinetist clarinetist is offline
Member
Non-Actuary
 
Join Date: Aug 2011
Studying for Rcpp, Git
Posts: 6,703
Default

I really want to learn D3.js, but I don't have the time to learn v. 4 when there aren't any resources on it (yet). Everything is still in v.3.
__________________
If you want to add me on LinkedIn, PM me.

Why I hate Microsoft Access.

Studying/Reading: Statistical Inference, Bayesian Data Analysis
Reply With Quote
  #243  
Old 05-09-2017, 05:25 PM
Meshuga's Avatar
Meshuga Meshuga is offline
Member
Non-Actuary
 
Join Date: Dec 2001
Posts: 10,355
Default

john (21) vs paul (6) vs george (158) vs ringo (39)

yoko (5)

moe (30) vs larry (19) vs curly (16) vs shemp (0)
groucho (2) vs chico (130) vs harpo (11)
coke (0) vs pepsi (24)
__________________
I know I don't talk in my sleep. Someone at work would have told me by now.
Reply With Quote
  #244  
Old 05-16-2017, 10:55 AM
campbell's Avatar
campbell campbell is offline
Mary Pat Campbell
SOA AAA
 
Join Date: Nov 2003
Location: NY
Studying for duolingo and coursera
Favorite beer: Murphy's Irish Stout
Posts: 77,671
Blog Entries: 6
Default

http://www.atlasobscura.com/articles...eid=b680287046

Quote:
Florence Nightingale Was Born 197 Years Ago, and Her Infographics Were Better Than Most of the Internet’s
The famed nurse was also an early practitioner of marshaling statistics to advance social causes.


......
Nightingale had always had an affinity for math—as a child, she filled notebooks with tables of data about the fruits and vegetables in her garden, and according to one of her contemporaries, Francis Galton, she believed that statistics were the most effective way to “understand God’s thoughts.”

Her months in the war hospitals of Crimea provided her with plenty of opportunities to gather information, something that, in her view, those in charge had been fairly lax about. “The Army Medical Statistics… do not appear hitherto to have contemplated the necessity of [tabulating the sick at a given time],” she later wrote. “It cannot be ascertained correctly even for the Crimean Army.”




https://archive.org/details/mortalityofbriti00lond





__________________
It's STUMP

LinkedIn Profile
Reply With Quote
  #245  
Old 05-19-2017, 11:47 AM
campbell's Avatar
campbell campbell is offline
Mary Pat Campbell
SOA AAA
 
Join Date: Nov 2003
Location: NY
Studying for duolingo and coursera
Favorite beer: Murphy's Irish Stout
Posts: 77,671
Blog Entries: 6
Default

NBA shot charts
http://www.eyalshafran.com/grantland_shotchart.html

https://www.reddit.com/r/dataisbeaut...199697_season/



__________________
It's STUMP

LinkedIn Profile
Reply With Quote
  #246  
Old 06-02-2017, 03:49 PM
campbell's Avatar
campbell campbell is offline
Mary Pat Campbell
SOA AAA
 
Join Date: Nov 2003
Location: NY
Studying for duolingo and coursera
Favorite beer: Murphy's Irish Stout
Posts: 77,671
Blog Entries: 6
Default



Spoiler:
alt-text: The top search for every state is PORN, except Florida, where it's SEX PORN.
__________________
It's STUMP

LinkedIn Profile
Reply With Quote
  #247  
Old 06-02-2017, 09:48 PM
ahow's Avatar
ahow ahow is offline
Member
CAS
 
Join Date: Nov 2003
Location: Burninating the Indiana
Favorite beer: Stone 11th Anniversary Ale
Posts: 12,202
Default

Quote:
Originally Posted by campbell View Post
snip

Spoiler:
alt-text: The top search for every state is PORN, except Florida, where it's SEX PORN.
That alt-text is A++++. Would read again.
__________________
ahow
Badass
Reply With Quote
Reply

Tags
data science, predictive analytics

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 06:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.28621 seconds with 10 queries