Skip to content

Instantly share code, notes, and snippets.

@ahandsel
Last active December 9, 2020 06:56
Show Gist options
  • Save ahandsel/44b5a46580f5df06a8ee73b238422de4 to your computer and use it in GitHub Desktop.
Save ahandsel/44b5a46580f5df06a8ee73b238422de4 to your computer and use it in GitHub Desktop.

No Server Data Visualization: Build a Bubble Cloud Project!

Thank you for attending our Kintone x Bubble Cloud workshop!

Use the following CSV file, CDN URLs, visualization.js, and PDF files for the hands-on section!

Download Links

Click here or the Download Zip button on the upper right corner for all the code, data, & slide you need for our workshop!

Getting your FREE Kintone Database

Step 1 - Sign Up for Kintone Developer Account (Website)

  • bit.ly/KDP_signup
    • ⚠ Do NOT use Safari
    • ⚑Accept Cookies First
    • βœ… Use Chrome & Firefox

Step 2 - Create a Kintone Subdomain (Environment)

  • bit.ly/K_DevLic
    • ⚑ Only use lowercase, numbers, & hyphens in your subdomain
    • ⚠ Do not use uppercase nor special characters

Quick video on the sign-up process:

https://youtu.be/Gzz8SbTuoFg https://youtu.be/Gzz8SbTuoFg

References

The data on the Marvel Cinematic Universe Films's box office performance came from the List of Marvel Cinematic Universe films Wikipedia article.

Film US Release Date Worldwide Box office gross (USD) Series All time ranking
Iron Man 5/2/2008 585366247 Iron Man 170
The Incredible Hulk 6/13/2008 264770996 The Incredible Hulk 571
Iron Man 2 5/7/2010 623933331 Iron Man 151
Thor 5/6/2011 449326618 Thor 256
Captain America: The First Avenger 7/22/2011 370569774 Captain America 346
Marvel's The Avengers 5/4/2012 1518812988 Avengers 8
Iron Man 3 5/3/2013 1214811252 Iron Man 19
Thor: The Dark World 11/8/2013 644783140 Thor 139
Captain America: The Winter Soldier 4/4/2014 714421503 Captain America 112
Guardians of the Galaxy 8/1/2014 772776600 Guardians of the Galaxy 98
Avengers: Age of Ultron 5/1/2015 1402805868 Avengers 10
Ant-Man 7/17/2015 519311965 Ant-Man 205
Captain America: Civil War 5/6/2016 1153296293 Captain America 21
Doctor Strange 11/4/2016 677718395 Doctor Strange 127
Guardians of the Galaxy Vol. 2 5/5/2017 863756051 Guardians of the Galaxy 71
Spider-Man: Homecoming 7/7/2017 880166924 Spider-Man 64
Thor: Ragnarok 11/3/2017 853977126 Thor 74
Black Panther 2/16/2018 1346913161 Black Panther 11
Avengers: Infinity War 4/27/2018 2048359754 Avengers 5
Ant-Man and the Wasp 7/6/2018 622674139 Ant-Man 150
Captain Marvel 3/8/2019 1128274794 Captain Marvel 24
Avengers: Endgame 4/26/2019 2797800564 Avengers 1
Spider-Man: Far From Home 7/2/2019 1131927996 Spider-Man 23
// Order matters when inserting CDN URLs into Kintone App settings
https://www.amcharts.com/lib/4/core.js
https://www.amcharts.com/lib/4/charts.js
https://www.amcharts.com/lib/4/plugins/forceDirected.js
(function () {
'use strict';
// Kintone event triggered after the record list page is displayed.
kintone.events.on('app.record.index.show', function (event) {
// Retrieve & configure the space element below the record list's header
var spaceDiv = kintone.app.getHeaderSpaceElement();
spaceDiv.style.height = '400px';
spaceDiv.style.marginLeft = '25px';
spaceDiv.style.marginRight = '25px';
spaceDiv.style.border = 'solid';
spaceDiv.style.borderColor = '#ED7B84';
// Create chart instance
var chart = am4core.create(spaceDiv, am4plugins_forceDirected.ForceDirectedTree);
// Create series
var series = chart.series.push(new am4plugins_forceDirected.ForceDirectedSeries());
series.dataFields.value = 'value';
series.dataFields.name = 'name';
series.nodes.template.label.text = '{name}';
series.nodes.template.label.fill = am4core.color("#000000");
series.nodes.template.tooltipText = "{name}: [bold]${value}[/]";
series.fontSize = 13;
series.minRadius = 30;
series.maxRadius = 100;
console.log('event');
console.log(event);
var data = event.records.map(function (record) {
return {
// Film's default field code = Text
// Worldwide Box office's default field code = Number
'name': record.Text.value,
'value': record.Number.value
}
});
series.data = data;
console.log('data');
console.log(data);
});
})();

Thank you for attending our workshop!

Your Feedback Please πŸ™‡

Please fill out this quick survey for a chance to win πŸ’° Β₯2500 Amazon.co.jp Gift Card:

Next Step πŸ‘©β€πŸ’»πŸ’ͺ

For those wanting more visualization projects:

  • Try linking to different amChart libraries, and reuse the code we used in the workshop!

For those wanting to create projects on Kintone and want to retrieve & store data from public APIs:

For those wanting to use Kintone as a back-end database:

Where to Get Help? 🧐

(function () {
'use strict';
var url = "https://xkcd.com/327/info.0.json";
kintone.events.on('app.record.index.show', function (event) {
kintone.proxy(url, 'GET', {}, {}, function (success) {
var jsonResponse = JSON.parse(success);
console.log(jsonResponse);
window.open(jsonResponse.img, "", "width=800, height=200, top=200");
}, function (error) {
console.log(error);
});
return event;
});
})();
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment