Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
<div id="introchart"></div>


                body {
  background: #303950;
  margin: 0px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

#introchart {
  width: 100%;
  height: 350px;
  position: absolute;




// main container
var mainContainer = am4core.create("introchart", am4core.Container);
mainContainer.width = am4core.percent(100);
mainContainer.height = am4core.percent(100);

var mapChart = mainContainer.createChild(am4maps.MapChart);
mapChart.geodata = am4geodata_continentsHigh;
mapChart.projection = new am4maps.projections.Mercator();

var continentSeries = mapChart.series.push(new am4maps.MapPolygonSeries());
continentSeries.useGeodata = true;
continentSeries.exclude = ["antarctica"];
continentSeries.mapPolygons.template.fill = am4core.color("#222a3f");
continentSeries.mapPolygons.template.stroke = am4core.color("#313950");

// create first image container
var imageSeries = mapChart.series.push(new am4maps.MapImageSeries());
var city1 = imageSeries.mapImages.create();
// London's latitude/longitude
city1.latitude = 51.5074;
city1.longitude = 0.1278;
// prevent from scaling when zoomed
city1.nonScaling = true;

// add circle to it
var circle1 = city1.createChild(am4core.Circle);
circle1.radius = 6;
circle1.fill = am4core.color("#eeeab5");

// second city, New York
var city2 = imageSeries.mapImages.create();
// NY latitude/longitude
city2.latitude = 40.7128;
city2.longitude = -74.0060;
// prevent from scaling when zoomed
city2.nonScaling = true;

// add circle to it
var circle2 = city2.createChild(am4core.Circle);
circle2.radius = 6;
circle2.fill = am4core.color("#eeeab5");

// create line series
var lineSeries = mapChart.series.push(new am4maps.MapLineSeries());
var mapLine = lineSeries.mapLines.create();
// tell the line to connect cities (alternatevely you can also specify latitudes/longitudes)
mapLine.imagesToConnect = [city1, city2]
// make it dashed
mapLine.line.strokeDasharray = "1,1";
mapLine.line.strokeOpacity = 0.2;

mapChart.homeZoomLevel = 3;
mapChart.homeGeoPoint = { latitude: 50, longitude: -30 };

// create plane container
var planeContainer = mapLine.lineObjects.create();
planeContainer.position = 0;
// set svg path of a plane for the sprite
var plane = planeContainer.createChild(am4core.Sprite);
planeContainer.nonScaling = false;
planeContainer.scale = 0.015;

plane.path = "M71,515.3l-33,72.5c-0.9,2.1,0.6,4.4,2.9,4.4l19.7,0c2.8,0,5.4-1,7.5-2.9l54.1-39.9c2.4-2.2,5.4-3.4,8.6-3.4 l103.9,0c1.8,0,3,1.8,2.3,3.5l-64.5,153.7c-0.7,1.6,0.5,3.3,2.2,3.3l40.5,0c2.9,0,5.7-1.3,7.5-3.6L338.4,554c3.9-5,9.9-8,16.2-8c24.2,0,85.5-0.1,109.1-0.2c21.4-0.1,41-6.3,59-17.8c4.2-2.6,7.9-6.1,11.2-9.8c2.6-2.9,3.8-5.7,3.7-8.5c0.1-2.8-1.1-5.5-3.7-8.5c-3.3-3.7-7-7.2-11.2-9.8c-18-11.5-37.6-17.7-59-17.8c-23.6-0.1-84.9-0.2-109.1-0.2c-6.4,0-12.3-2.9-16.2-8L222.6,316.6c-1.8-2.3-4.5-3.6-7.5-3.6l-40.5,0c-1.7,0-2.9,1.7-2.2,3.3L237,470c0.7,1.7-0.5,3.5-2.3,3.5l-103.9,0c-3.2,0-6.2-1.2-8.6-3.4l-54.1-39.9c-2.1-1.9-4.7-2.9-7.5-2.9l-19.7,0c-2.3,0-3.8,2.4-2.9,4.4l33,72.5C72.6,507.7,72.6,511.8,71,515.3z";
plane.fill = am4core.color("#eeeab5");

plane.horizontalCenter = "middle";
plane.verticalCenter = "middle";"ready", goForward);

function goForward() {
    var animation = planeContainer.animate({ property: "position", from: 0, to: 1 }, 3000).delay(300);
    plane.rotation = 0;"animationended", goBack);

function goBack() {
    var animation = planeContainer.animate({ property: "position", from: 1, to: 0 }, 3000).delay(300);"animationended", goForward);
    plane.rotation = 180;

// make the plane to be bigger in the middle of the line
planeContainer.adapter.add("scale", function(scale, target) {
    return (0.07 - 0.10 * (Math.abs(0.5 - target.position))) / mapChart.zoomLevel;