D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jo-fu
Full window
Github gist
Canada map
<!DOCTYPE html> <meta charset="utf-8"> <style> html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; width: 100%; } svg path { stroke-width: 0px; stroke: #fff; transition: fill 0.5s ease; fill: #DECEAA; } svg .active { stroke-width: 1px; fill: #48B49C; } </style> <script src="https://d3js.org/d3.v3.min.js"></script> <body> <script> var states = [ { "id" : "ON" , "state" : "Ontario" , "path" : "M284.447,356.388 c-1.072,1.115-3.119,1.102-4.127,0.089c-3.439-3.463-8.529-3.099-12.293-5.678c-1.463,1.515-2.201,0.312-2.967-0.791l-0.09-0.062 c-1.738-0.204-2.699-1.18-2.893-2.915l-0.08-0.13c-1.748-3.128-3.656-6.228-1.793-10.003c-1.332-8.284-1.059-16.772-3.182-24.956 c-1.436-0.166-3.191,0.545-4.227-0.774c-5.562-7.085-12.254-13.854-11.489-23.764c0.485-6.286-2.635-7.022-7.556-6.982 c-8.324,0.067-14.918-4.157-21.03-9.239c-1.795-1.492-3.265-3.565-5.772-1.197l0.089-0.024c-0.338,0.345-0.674,0.688-1.012,1.032 c-0.325,0.381-0.651,0.76-0.977,1.14c-8.344,9.415-16.083,19.367-25.306,28.003c-3.16,2.958-1.274,7.512-2.772,11.07 c1.062,5.73,1.029,11.465,0.079,17.204c-0.046,0.487-0.092,0.976-0.138,1.463c2.529,1.653,1.323,6.284,5.148,6.768 c5.504,0.696,10.363,3.212,15.505,4.951c4.521,1.528,9.473,2.1,12.812-2.324c2.384-3.159,4.553-4.623,8.633-3.243 c2.177,0.736,4.673,0.204,4.873,3.527c0.096,1.584,1.544,2.273,2.761,2.531c4.062,0.861,5.455,3.819,6.441,7.339 c1.248,4.451,4.185,6.497,8.912,6.173c3.846-0.264,7.626,0.547,11.283,1.675c3.51,1.081,6.123,3.306,7.344,6.895 c0.617,1.812,0.229,3.049-2.006,2.701c-1.736-0.271-3.617-2.445-4.957,0.641c-0.801,1.845-1.434,3.68-1.553,5.725 c-0.381,6.416-2.188,12.263-7.109,16.771c1.333,0,2.667,0,4,0c4.188-5.489,10.707-6.839,16.576-9.354 c1.256-0.539,4.205-1.096,1.459-2.793c-3.953-2.443-1.33-3.51,0.457-4.772c1.908-1.349,4.191-1.837,6.498-2.305 c8.795-1.782,13.139-8.469,16.928-15.706C288.703,355.164,286.41,354.352,284.447,356.388z M214.03,328.713c0,0-1.259-0.171-3.017,0 s-2.13-2.393-1.853-4.614s3.055-3.149,3.055-3.149s0,0,1.725,0.896S214.03,328.713,214.03,328.713z"}, { "id" : "AB" , "state" : "Alberta" , "path" : " M77.953,222.972c-1.782-2.093,1.36-3.164,1.027-4.957c6.011,0.956,11.276,3.989,16.893,6.049c4.256,2.158,8.735,3.699,13.359,4.842 c3.344,0.599,6.667,1.27,9.757,2.769c0.119,1.004,0.909,2.019-0.051,3.003c-1.451,2.709-4.942,3.737-5.94,6.834 c1.363,1.102,2.752,0.17,3.985,0.581c-0.101,4.21-2.515,8.02-2.13,12.313c-0.544,0.271-1.504,0.467-1.571,0.827 c-1.798,9.664-5.222,18.971-6.332,28.781l0.036-0.061c-1.673,3.478-2.343,7.214-2.838,10.995 c-0.692,8.874-4.788,17.068-5.188,26.001c-8.101-0.922-16.223-1.775-22.952-7.117c-0.148-0.2-0.172-0.414-0.07-0.642 c1.063-4.266,3.068-8.608-1.021-12.451c-4.138-2.701-3.833-7.227-4.639-11.294c-0.721-2.352-0.938-4.968-3.338-6.454l0.052,0.068 c-0.188-3.271-0.868-6.297-4.049-8.066l0.065,0.062c-0.359-0.688-0.719-1.376-1.077-2.064c-1.201-1.063-1.591-2.377-1.07-3.887 c2.344-6.799,4.714-13.588,7.075-20.38c0.02-0.548,0.039-1.097,0.06-1.646l0.046-0.057c3.384-2.551,3.595-6.341,3.938-10.079 c0,0-0.042,0.062-0.042,0.062C75.724,233.09,75.887,227.623,77.953,222.972z"}, { "id" : "Man" , "state" : "Manitoba" , "path" : "M197.703,265.767 c-4.806,0.46-5.41-1.182-5.809-5.177c-0.42-4.211-0.357-9.309-6.779-9.764c-1.781-0.126-2.068-1.905-1.996-3.5 c0.083-1.817,0.183-3.635,0.274-5.451c-4.33-0.843-8.839-0.375-13.088-1.789c-1.325-0.073-2.653-0.146-3.981-0.22 c-3.833-0.121-7.615-0.583-11.299-1.698c-2.962-0.382-1.48,2.83-2.954,3.652c-0.56,3.087,1.046,6.454-1.21,9.32 c1.593,5.302-1.105,9.965-2.213,14.864c0.368,14.618-1.732,29.102-2.454,43.661c-0.243,4.912,0.351,9.929-1.072,14.767 c-0.155,1.83,0.108,3.745-1.089,5.364c9.134,0.994,18.28,1.894,27.396,3.042c2.771,0.35,4.133-1.105,5.484-2.967 c0.046-0.487,0.092-0.976,0.138-1.463c-1.82-5.728-0.722-11.469-0.079-17.206c1.498-3.557-0.388-8.11,2.772-11.068 c9.223-8.636,16.962-18.588,25.306-28.003c-0.03-0.677,0.162-1.162,0.92-1.162c-0.018-0.673,0.216-1.102,0.973-1.018 C206.009,264.034,200.675,265.482,197.703,265.767z M170.744,321.929c-0.761-0.504-1.738-3.106-1.461-4.495 s-0.833-5.276-2.222-6.387s-6.845-8.739-7.498-9.72c-2.776-4.166,1.111-5.832,1.389-8.609s4.166-3.888,4.166-3.888 s2.231,3.608,1.132,6.107c-0.312,0.711,1.571,5.099,2.2,6.667c1.582,3.94,3.292,9.601,3.888,9.997 C173.171,312.156,171.505,322.433,170.744,321.929z"}, { "id" : "Sask" , "state" : "Saskatchewan" , "path" : "M152.071,241.82c-0.56,3.087,1.046,6.454-1.209,9.319c-1.031,4.813-5.714,8.398-4.683,13.907c-0.096,0.639,0.127,0.93,0.798,0.736 c0.415,0.072,0.83,0.146,1.244,0.218c-0.644,5.402-1.156,10.798-1.302,16.259c-0.162,6.075-1.57,12.135-1.51,18.192 c0.079,8.003-2.788,15.97-0.288,23.98c-0.155,1.83,0.108,3.745-1.089,5.364c-14.827-0.8-29.21-4.105-43.526-7.762 c-0.57-0.146-1.032-0.714-1.545-1.086c0.398-8.933,4.494-17.127,5.186-26.001c2.818-3.182,2.889-7.073,2.839-10.995l-0.036,0.061 c1.06-0.446,1.3-1.497,1.516-2.4c2.167-9.061,4.269-18.137,6.388-27.208c-0.385-4.294,2.029-8.104,2.129-12.313 c1.161-1.39,2.247-2.481,4.47-2.2c2.894,0.367,5.869,0.09,9.675,0.09c-4.19-3.494-8.812-2.855-12.188-5.305 c0.96-0.984,0.17-1.999,0.051-3.003c8.963,1.863,17.926,3.728,26.881,5.593C148.039,238.638,152.658,236.682,152.071,241.82z"}, { "id" : "" , "state" : "Yukon" , "path" : " M61.728,210.094c-6.868-1.43-12.598-5.41-18.606-8.636c-7.034-3.775-13.675-8.286-20.458-12.524 c-1.193-0.745-2.429-0.952-3.77-0.896c0-0.001,0.117,0.062,0.116,0.062c-2.564-3.482-6.629-4.866-10.034-7.174 c-0.191-0.634-0.75-1.55-0.515-1.857c2.342-3.06,1.487-4.477-2.138-5.218c-3.228-0.66-2.021-2.565-0.828-4.357 c7.807-11.735,15.572-23.499,23.383-35.232c5.973-8.972,11.983-17.92,18.01-26.856c0.682-1.012,1.035-2.722,2.83-2.183 c1.274,0.383,2.448,1.092,2.702,2.617c0.687,4.125,2.771,7.694,4.526,11.395c-3.005,5.021-6.191,9.965-6.916,15.973 c-0.095,1.457,0.81,1.796,2.015,1.797l-0.07-0.042c0.393,0.938,1.002,1.445,2.069,1.039l-0.048-0.044 c0.55,2.494-1.204,4.664-1.006,7.109c-0.494,3.004,3.153,5.316,1.426,8.524c0.001-0.001,0.007-0.041,0.007-0.041 c-0.264,0.216-0.527,0.432-0.788,0.646c-3.537,1.524-4.019,4.136-3.157,7.645c0.962,3.919,3.74,7.214,3.755,11.417 c-2.269,6.609-2.673,13.132,0.868,19.486c0.237,0.427,0.517,0.938,0.487,1.391c-0.363,5.521,1.036,9.732,7.141,11.365 c1.995,0.533,0.641,2.506,0.278,3.853C62.581,209.598,62.154,209.846,61.728,210.094z"}, { "id" : "BC" , "state" : "British Columbia" , "path" : "M3,240c0,4,0,8,0,12 c3.072-1.076,2.79-4.56,4.661-6.557c0.979-1.043,3.358-2.2,1.078-4.302C7.033,239.568,5.428,237.804,3,240z M78.98,218.015 l0.108-0.122c-5.94-1.03-11.16-4.067-16.747-6.081c-0.364-0.131-0.417-1.125-0.614-1.718c-6.868-1.43-12.598-5.41-18.606-8.636 c-7.034-3.775-13.675-8.286-20.458-12.524c-1.173-0.732-2.389-0.941-3.705-0.896c-2.567-3.435-6.6-4.82-9.982-7.113 c-2.581,2.556,0.215,5.178-0.083,7.782c-0.389,3.393,1.451,3.141,3.479,1.784c2.017-1.35,3.837-3.045,6.538-2.413 c3.938,9.698,5.638,19.613,3.152,30.012c-0.48,2.009,0.46,3.859,1.6,5.586c3.56,5.392,2.122,12.181-3.525,15.241 c-2.614,1.417-3.338,3.143-3.321,5.933c0.062,10.079,2.903,20.041,1.234,30.183c0.279-0.009,0.446,0.123,0.5,0.396 c1.986,1.184,3.869,2.441,3.971,5.655c-2.649-1.008-3.61-3.038-4.789-4.842c-0.306-0.356-0.612-0.713-0.918-1.068 c-1.299-0.467-2.553-2.132-3.976-0.593c-1.089,1.179-1.037,2.859-0.391,4.254c2.355,5.09,4.534,10.301,7.38,15.11 c1.649,2.787,3.109,5.896,5.801,7.995c1.377,1.073,3.151,1.884,4.597,0.95c1.529-0.988,0.385-2.736-0.049-4.086 c-0.506-1.573-1.217-3.08-1.84-4.615c5.299,7.728,14.31,8.094,21.733,11.258c7.9,3.368,15.988,6.388,24.436,8.233 c0.169-0.288,0.371-0.551,0.606-0.787c-0.064-4.052-0.129-8.104-0.193-12.154c-4.138-2.701-3.833-7.227-4.639-11.296 c-2.115-1.632-3.334-3.728-3.338-6.452l0.052,0.068c-1.752-2.487-3.197-5.128-4.049-8.066l0.065,0.062 c-0.359-0.688-0.719-1.376-1.077-2.064c-1.201-1.063-1.591-2.377-1.07-3.887c2.344-6.799,4.714-13.588,7.074-20.381 c-0.621-0.572-0.324-1.11,0.061-1.646l0.046-0.057c0.937-3.507,1.725-7.071,3.938-10.079l-0.042,0.062 c1.572-4.863,1.878-10.269,6.015-14.032C76.171,220.879,79.313,219.808,78.98,218.015z"}, { "id" : "" , "state" : "Northwest Territories" , "path" : "M156.787,199.65c-0.543-2.017-2.94-2.072-3.881-3.669 c-0.564-0.064-1.177-0.082-0.973-0.908c-0.965,0.278-1.776,0.248-1.974-1.007c-1.239,0.387-2.239,0.063-2.982-1.012 c-0.869,0.059-1.682,0.002-2.015-1.004c-2.39-0.212-4.436-1.106-5.984-2.995c-0.861,0.062-1.778,0.23-1.967-1.018 c-3.621-3.443-5.448-8.82-12.042-8.966c-2.595-0.057-4.294-4.049-6.033-6.543c-3.431-4.916-7.593-9.34-10.107-14.878 c-1.077-0.02-1.917-0.313-1.879-1.615c-0.971-0.343-1.202-1.057-1.013-1.981c-0.735,0.055-0.922-0.435-0.986-1.045 c-1.983-1.47-2.32-3.131-1.279-5.527c1.177-2.712,1.761-5.682,2.604-8.538c-0.107-2.128,0.265-4.362-1.68-6.012 c-2.684-2.275-5.538-0.466-8.635,0.001c0.808-2.168,2.08-4.405,0.667-5.566c-1.985-1.631-2.821,1.357-4.271,2.128 c-1.078,0.574-2.06,0.644-2.124-0.768c-0.192-4.281,0.543-9.19-6.459-7.737c-1.525-4.618-5.378-2.681-8.409-2.933 c-3.32-0.276-7.176,2.968-9.898-1.707c-0.285-0.49-2.524,0.369-3.804,0.2c-2.355-0.312-2.355,3.221-4.717,2.683 c-3.005,5.021-6.191,9.964-6.915,15.973c0.797,0.438,2.385-0.01,2.022,1.729c1.04-0.399,1.656,0.047,1.989,1.058 c3.934,2.963,0.536,4.889-1.051,7.072c-0.494,3.004,3.153,5.316,1.425,8.526l0.008-0.043c-0.264,0.216-0.527,0.432-0.791,0.647 c-2.134,3.555-2.054,7.085-0.258,10.809c1.24,2.569,1.535,5.4,0.859,8.252c-2.269,6.609-2.673,13.132,0.868,19.486 c0.237,0.427,0.517,0.938,0.487,1.391c-0.363,5.521,1.036,9.732,7.141,11.365c1.995,0.533,0.641,2.506,0.279,3.854 c3.526,2.901,8.076,3.579,12.027,5.549c1.501,0.748,3.781,0.545,4.052,2.991l-0.108,0.122c6.011,0.956,11.276,3.989,16.892,6.049 c4.921,0.324,9.683,1.088,13.36,4.842c3.344,0.599,6.667,1.27,9.756,2.768c8.964,1.864,17.927,3.729,26.89,5.594 c2.014-0.119,4.026-0.237,6.04-0.356c1.062-11.239,2.094-22.481,3.233-33.713C155.28,201.935,154.499,200.012,156.787,199.65z M90.262,174.267c-0.212-0.438-0.424-0.876-0.636-1.314c-1.713,0.935-3.655,1.554-4.846-0.389c-1.32-2.151,1.033-3.112,2.146-4.372 c0.536-0.607,1.338-0.974,1.987-1.489c0.754-0.599,2.019-1.178,1.482-2.251c-0.354-0.711-1.538-1.162-2.438-1.41 c-1.564-0.432-3.305-0.341-5.031-2.28c5.949,0,11.33,0,17.559,0c-4.235,3.781-2.143,5.012,1.396,5.916 c1.433,0.365,3.959,0.627,3.083,2.889c-0.676,1.741-2.587,3.165-4.88,1.82c-2.45-1.437-3.73-0.798-4.897,1.807 C94.302,175.17,92.453,176.447,90.262,174.267z M117.515,212.729c-2.979,1.466-6.108,2.631-9.053,4.157 c-6.159,3.193-9.643,2.502-14.487-3.493c11.146-1.953,11.146-1.953,8.35-12.337c3.953,2.273,5.138,7.007,9.314,8.841 c4.804,2.109,7.327-4.425,12.277-2.791C122.366,210.071,119.996,211.507,117.515,212.729z M120.23,135.988 c4.363-3.084,8.358,0.585,12.99,0.824c-0.949-2.582-3.066-3.044-4.952-3.646c-1.891-0.604-3.861-0.966-5.803-1.404 c-2.371-0.534-4.493-1.305-4.841-4.195c-0.393-3.275,3.061-1.788,4.09-3.803c-3.287-2.426-4.205-5.953-2.413-10.117 c-2.492-0.121-3.349,1.538-4.075,2.856c-2.115,3.842-5.748,3.353-9.169,3.581c-0.321,0.022-0.694-0.015-0.973-0.159 c-1.356-0.709-4.053-12.941-3.133-14.198c2.553-3.484,5.13-6.951,7.681-10.437c0.685-0.934,1.488-1.836,1.926-2.883 c0.747-1.789-0.703-4.989,2.551-5.084c2.915-0.085,6.054,0.466,8.1,2.985c1.903,2.346,3.867,3.831,7.02,4.837 c3.395,1.083,3.798,5.526,3.65,9.019c-0.047,1.104-0.768,2.53,0.605,2.531c4.942,0.007,2.714,3.207,2.499,5.478 c3.49-0.542,6.47-0.055,7.065,3.801c0.411,2.664,2.128,0.477,2.943,1.204c-1.292,7.053-3.274,13.923-5.391,20.766 c-0.512,1.653-0.406,2.727-2.966,2.515C131.526,139.949,125.919,137.902,120.23,135.988z M119.871,112.16 c-0.257,0.146-0.699,0.258-0.735,0.447c-0.09,0.474,0.017,1.003,0.729,0.678c0.283-0.129,0.507-0.389,0.758-0.589 C120.376,112.515,120.129,112.332,119.871,112.16z M151.068,94.01 c-0.393,2.771-2.774,3.13-4.776,3.663c-2.743,0.731-5.743,0.569-6.71-2.554c-1.056-3.407,3.068-1.949,4.485-4.065 c-4.598-1.601-12.185-0.357-9.961-9.017l-0.095,0.035c1.312,0.063,1.893-0.333,1.027-1.637c1.043,0.404,1.534-0.271,1.992-1.015 c0.044-1.764,2.961-2.246,1.989-4.462l-0.093,0.104c5.805,0.257,8.895,2.647,10.342,8.835c0.547,2.339,1.801,3.29,3.693,4.02 C152.991,90.154,150.767,91.689,151.068,94.01z M130.983,76.921 c-2.747,0.93-4.404-1.667-6.782-2.17c-2.185-0.462-0.676-2.183,0.184-2.955c4.081-3.67,9.322-5.492,13.91-8.379 c1.282-0.807,3.703-0.447,5.096,0.972c1.55,1.578-0.212,3.062-0.531,4.567c-0.529,2.505-2.862,3.912-3.932,6.108 c0-0.001,0.093-0.105,0.093-0.105c-2.986-0.521-6.127-1.667-8.073,2.003L130.983,76.921z M147.934,60.688 c3.582,1.439,7.807-1.938,9.828,2.22c0.875,1.8,0.019,5.74-2.828,5.962C150.074,69.249,149.204,65.024,147.934,60.688z M157.102,54.772 c1.09,0.158,2.762-0.45,2.405,1.447c-0.232,1.242,0.062,3.557-1.977,3.257c-1.531-0.225-3.967-1.576-4.075-2.625 C153.253,54.892,155.646,55.081,157.102,54.772z M137.031,79.421 c-0.458,0.743-0.949,1.419-1.992,1.015c-0.489,0.453-1.184,0.778-1.027,1.637l0.095-0.035c-6.992,1.926-2.74-3.01-3.123-5.116 c0,0-0.036,0.041-0.036,0.042C132.641,78.609,136.202,75.635,137.031,79.421z"}, { "id" : "Que" , "state" : "Quebec" , "path" : "M309.062,224.918 c-0.008,0.028-0.01,0.055-0.016,0.082c0.004,0,0.008,0,0.014,0C309.061,225.001,309.062,224.918,309.062,224.918z M312.035,269.945 c-0.027-0.008-0.047-0.008-0.072-0.015c-0.002,0.041-0.01,0.072-0.012,0.114L312.035,269.945z M365.037,276.095 c-1.842,3.165-5.023,2.669-7.938,2.901l-0.15,0.087c-0.973,2.217-2.857,2.155-4.809,1.928l-0.189,0.094 c-0.248,1.042-0.99,1.078-1.836,0.9l-0.164,0.086c-1.998,2.646-4.811,3.09-7.855,2.902l-0.057,0.027 c-2.973,2.113-6.613,0.967-9.803,2.008c-0.215,1.974,0.061,4.312-3.059,4.137c-3.613,0.832-7.4,0.888-9.527-2.418 c-1.248-1.941-4.678-0.685-4.508-3.789c0.236-2.677-1.867-3.925-3.355-5.576c-2.387-2.646-3.162-5.471-0.635-8.511 c0.076-0.5-0.01-1.151,0.811-0.94c0.156-2.826,1.812-3.563,4.139-2.424c1.5,0.735,2.602,0.998,3.785-0.276 c0.486-0.069,0.979-0.222,1.461-0.197c5.939,0.296,6.299-0.706,4.139-6.38c-1.617-4.242-4.184-8.06-5.082-12.726 c-0.334-1.73,0.801-5.757-3.262-6.03c-1.498-4.843-5.82-8.431-6.127-13.803l-0.104-0.134c-0.607,0.013-0.854-0.327-0.869-0.891 l-0.096-0.133c-0.906-0.38-1.094-1.076-0.9-1.938c-2.807-0.182-1.809,2.111-2.016,3.383c-0.535,3.275-0.463,6.702-1.992,9.723 c-0.922,1.824-1.865,3.989-4.82,3.045c-7.303-2.335-11.127-7.371-11.217-14.914c-0.039-3.25-1.689-3.98-4.217-4.222 c-3.039-0.291-5.453-0.998-7.314-4.059c-1.838-3.022-6.553-5.649-8.816-4.597c-4.754,2.211-9.074,0.924-13.602,1.053 c-2.32,0.067-5.819,1.301-4.504,3.846c2.604,5.04,1.283,10.943,4.395,15.699c1.814,2.771,1.375,5.613-0.062,8.527 c-3.01,6.106-2.844,7.263,2.836,11.062c4.664,3.119,6.586,7.283,6.488,12.659c-0.121,6.776-4.008,11.52-8.814,15.558 c-2.373,1.993-2.318,3.301-1.072,6.163c3.168,7.28,8.758,14.567,2.688,23.032c-0.152,0.214,0.004,0.65,0.018,0.983 c2.123,8.184,1.85,16.672,3.182,24.956c0.598,3.334,1.195,6.669,1.793,10.003l0.08,0.13c1.348,0.591,2.312,1.562,2.893,2.915 l0.09,0.062c1.086-0.097,2.133-0.053,2.967,0.792c3.764,2.578,8.854,2.214,12.293,5.677c1.008,1.013,3.055,1.026,4.127-0.089 c1.963-2.036,4.256-1.224,6.471-1.318c1.193,1.229,1.879,2.963,4.281,2.544c13.578-2.367,15.709-1.14,17.975-15.504 c0.129-0.813,0.396-1.607,0.5-2.424c0.504-3.926,1.551-7.388,6.344-7.826c1.666-7.037,8.15-6.719,13.184-8.186 c1.648-0.48,3.27-0.883,4.779-1.716c2.225-2.735,3.773-5.792,1.229-8.926c-2.527-3.113-5.732-1.638-8.637-0.267 c-3.943,1.859-7.32,4.548-10.578,7.409c-1.031,0.906-1.887,2.53-3.67,1.509c1.258-3.021,5.053-4.389,5.738-7.326 c1.551-6.643,6.371-8.873,11.996-10.49c5.742-1.651,11.494-3.264,17.227-4.947c5.02-1.475,8.414-4.591,9.451-9.87 c0.58-2.954,2.045-5.186,4.678-6.697c1.299-0.746,2.52-1.658,2.678-3.361C367.279,277.81,366.471,276.622,365.037,276.095z M345.975,304.288 c-2.971-0.453-7.855-1.499-8.193,1.673c-0.309,2.896,4.777,2.673,7.93,3.275c1.982-0.434,5.514,0.484,5.752-2.028 C351.691,304.809,348.086,304.611,345.975,304.288z"}, { "id" : "Atl" , "state" : "Altlantic Canada" , "path" : "M394.723,299.95c1.639-3.903,4.016-7.17-1.488-7.129 c-0.186,0.001-0.514-0.451-0.541-0.716c-0.635-6.059-4.23-3.295-7.25-2.506c-1.775,0.464-4.533,2.659-5.211,0.64 c-1.102-3.278-3.135-2.086-5.201-2.192c0.072-3.569,2.256-7.54-0.217-10.28c-2.854-3.162-3.189-7.235-4.928-10.705 c-2.004-3.998-3.867-5.995-8.229-6.149c-1.498-0.053-4.127-1.154-4.236-2.025c-0.66-5.312-4.639-3.974-7.41-3.616 c-6.553,0.847-11.092-3.698-16.627-5.492c-0.527-0.171-1.279-1.022-1.213-1.442c0.621-3.829-2.289-5.835-4.174-8.341 c-4.781-6.351-11.023-11.288-16.611-16.849c-2.586-2.573-2.125,0.38-2.316,1.777c0.82,0.439,1.006,1.157,0.877,2.014l0.096,0.133 c0.289,0.297,0.578,0.594,0.869,0.891l0.104,0.134c4.477,3.521,7.035,7.893,6.127,13.803c4.062,0.273,2.928,4.3,3.262,6.03 c0.898,4.666,3.465,8.483,5.082,12.726c2.16,5.674,1.801,6.676-4.139,6.38c-0.482-0.024-0.975,0.128-1.461,0.197 c-1.855,3.092-5.93-0.078-7.881,2.744c0.01-0.01,0.02-0.02,0.029-0.029l-0.084,0.1c0.018-0.026,0.037-0.044,0.055-0.07 c-0.283,0.299-0.57,0.598-0.854,0.896c-2.527,3.04-1.752,5.864,0.635,8.511c1.488,1.651,3.592,2.899,3.355,5.576 c5.305,0.652,8.732,5.551,14.035,6.207c3.119,0.175,2.844-2.163,3.061-4.136c-0.953-1.896,0.441-1.723,1.564-1.76 c2.744-0.091,5.49-0.167,8.236-0.249l0.057-0.027c2.465-1.387,4.908-2.827,7.855-2.902l0.164-0.086 c0.371-0.789,1.051-0.954,1.836-0.9l0.191-0.094c1.264-1.484,2.896-2.053,4.807-1.928l0.15-0.087 c2.236-2.087,5.01-2.706,7.938-2.901c1.434,0.527,2.242,1.715,3.055,2.896c1.127,0.086,1.906,0.332,1.385,1.799 c-1.422,4-1.018,8.179-1.098,12.313c-0.105,5.268-0.043,10.558-0.512,15.796c-0.502,5.586-0.461,5.773,4.799,4.07 c4.967-1.609,9.512-4.591,14.67-4.85c1.805,1.49-2.389,3.208,0.5,4.137c2.328,0.748,3.072-1.281,3.832-2.978 c0.938-2.094,1.914-4.171,2.873-6.255c1.061,5.742,4.244,6.234,8.459,4.976c0-3,0-6,0-9 C400.422,301.383,398.223,296.83,394.723,299.95z M328.6,273.291c-1.143,0.172-2.264,0.48-3.404,0.658 c-1.412,0.221-2.98,2.877-4.104,0.476c-0.742-1.59,1.721-2.536,2.824-3.656c1.682-1.706,4.162-0.233,6.121-1.16 c0.045-0.021,0.459,0.733,0.643,1.032C330.342,271.947,330.064,273.071,328.6,273.291z M369.213,327.416c-2.42-1.118-2.539-3.596-3.881-5.57 c-2.83,2.376-4.443,6.024-3.76,8.419c1.07,3.747-0.887,3.198-2.822,3.521c-0.98,0.163-1.975,0.254-2.963,0.378l-3.9,0.661 c-1.523-0.119-2.68,0.745-3.896,1.451c0.572-3.214-3.596-1.997-4.024-4.276c-3.72-1.174-3.282-4.392-3.056-7.114 c0.213-2.57-0.803-3.101-2.93-2.928c-1.51,0.833-3.131,1.235-4.779,1.716c-5.033,1.467-11.518,1.148-13.184,8.186 c2.752,0.105,5.492,0.333,6.084,3.79c0.836,4.892,2.279,10.42,7.033,11.718c4.994,1.363,8.502-3.443,11.666-7.117 c0.756,1.525,2.463,2.952-0.361,4.411c-1.385,0.716-2.477,2.205-3.41,3.547c-2.322,3.338-1.57,8.313,1.557,9.568 c4.111,1.65,5.455-1.581,7.029-4.384c1.014-1.802,0.705-4.197,2.904-5.492c6.988-4.114,11.342-10.94,16.789-16.642 C370.459,330.055,370.844,328.169,369.213,327.416z M352.887,331.825l3.9-0.661c1.656-5.376,1.66-4.36-3.953-3.373 c-1.459,0.257-2.961,0.443-4.344-0.322c-3.049-1.688-3.867-0.422-3.459,2.533C347.416,331.593,350.982,328.912,352.887,331.825z"}, { "id" : "" , "state" : "Nunavut" , "path" : "M192.883,36.931 c-1.577,1.431-2.732,8.749-2.688,10.61c0.128,5.274,5.285,2.633,7.365,4.81c-4.219,2.916-4.452,5.701-0.975,10.19 c2.878,3.715,5.433,3.433,11.888-1.919c-1.778,4.963,2.024,5.028,4.452,6.019c-0.627,1.662-1.574,1.565-2.628,1.513 c-4.112-0.203-5.441,1.588-3.035,5.067c1.646,2.38-0.357,2.654-1.458,3.697c-2.712,2.57-2.924,6.626-0.211,7.527 c3.396,1.128,7.21,1.631,10.498-0.271c2.948-1.705,7.145-0.924,8.17,0.076c2.901,2.831,4.529,1.262,6.101-0.564 c1.733-2.014,3.214-4.584,0.596-7.041c-1.358-1.276-1.563-2.253-0.505-3.799c1.706-2.49,2.146-5.494,4.181-8.087 c2.365-3.016,3.136-7.401-0.579-11.002c-1.194-1.158-3.241-3.15-0.485-4.789c5.098-3.03,8.564-6.99,9.296-13.128 c0.209-1.746,1.537-3.33,1.987-5.082c1.037-4.031,5.669-7.646,1.581-12.366c-0.13-0.15,0.302-0.844,0.539-1.245 c4.838-8.187,4.814-8.31-2.145-13.927C244.462,2.926,244.271,2.412,244,2c-4.333,0-8.667,0-13,0 c-1.327,1.991-3.562,1.564-5.351,1.611c-2.597,0.068-4.293,1.338-6.072,2.878c-2.842,2.458-3.161,8.092-8.83,7.071 c-0.248-0.044-0.783,0.645-0.935,1.079c-0.909,2.609-3.216,3.398-5.333,4.703c-2.108,1.299-7.192,2.86-1.361,6.256 c1.067,0.622,0.61,1.365,0.019,2c-1.665,1.791-0.652,3.08,0.463,4.743c1.645,2.453,3.188,4.3,6.355,2.494 c3.303,4.846,6.907,1.231,10.412,0.37c0.104-0.131,0.18-0.302,0.312-0.385c1.308-0.829,1.451-2.947,3.367-3.055 c0.188-0.011,0.586,0.47,0.577,0.711c-0.083,2.151-1.659,3.049-3.341,3.838c-1.65,1.312-3.326,2.593-4.938,3.951 c-0.56,0.471-0.312,1.714-1.85,0.581c-3.497-2.575-4.876-0.53-5.06,3.021c0.81,1.546,1.619,3.093,3.064,5.853 c-3.21-1.644-4.523-3.067-4.541-5.574c-2.438-4.159-4.884-8.314-7.313-12.479c-1.045-1.793-2.034-5.014-4.368-3.23 c-1.477,1.128-5.435,2.831-3.077,6.493C193.705,35.714,193.727,36.165,192.883,36.931z M244.287,19.786 c0.018-0.12,0.203-0.216,0.312-0.323c0.098,0.249,0.194,0.497,0.292,0.745c-0.193,0.124-0.385,0.245-0.576,0.367 C244.3,20.312,244.25,20.042,244.287,19.786z M213.116,51.893c1.565,1.183,2.336,2.518,3.001,4.475 c-1.515,0.476-3.168-0.479-4.986,0.064C211.771,54.97,212.41,53.508,213.116,51.893 M299.365,191.281 c-2.984-2.763-5.002-6.45-9.318-7.85c-1.895-0.614-3.445-2.574-4.912-4.146c-1.619-1.736-1.637-4.485-0.494-5.859 c1.424-1.715,3.291,0.279,4.645,1.397c2.303,1.899,4.062,4.444,6.809,5.812c1.557,0.774,3.387,1.062,4.814,0.196 c1.781-1.081-0.096-2.271-0.488-3.331c-0.49-1.324,0.85-1.675,1.043-2.479c0.877-3.66,2.289-7.391,1.459-11.144 c-0.842-3.801-4.273-0.902-6.312-1.838c-0.287-0.132-0.479-0.461-0.756-0.626c-4.961-2.944-9.922-5.5-15.928-6.194 c-4.555-0.527-5.217-3.99-1.785-7.172c1.193-1.105,0.762-1.704,0.48-2.896c-1.338-5.647-7.137-7.004-10.248-10.914 c-0.236-0.295-0.984-0.398-1.416-0.286c-2.898,0.753-4.188-1.129-5.553-3.128c-1.352-1.979-3.287-4.178-5.666-2.52 c-2.145,1.495-2.951,0.446-4.004-0.774c-1.303-1.508-2.432-3.162-3.641-4.749c-2.576-3.382-7.803-4.126-11.062-1.578 c-4.011,3.134-4.011,3.134-5.448-2.429c2.56,1.766,4.898,0.424,7.214-0.132c1.124-0.27,2.989,0.169,3.19-1.622 c0.158-1.41-1.075-2.371-2.022-3.289c-3.746-3.634-8.033-2.555-12.584-1.892c-8.277,1.206-12.112,5.637-11.098,13.932 c0.133,1.085,0.608,2.328-1.204,2.72c-2.567-4.402-0.439-8.333,1.1-12.343c0.488-1.271,2.236-2.562,0.709-3.978 c-1.401-1.298-3.343-1.492-5.199-0.973c-2.609,0.73-4.107,2.745-5.267,5.015c-2.239,4.387-3.031,9.148-3.261,13.995 c-0.19,4.021-0.513,8.251,5.221,9.053c-1.344,1.372-4.813-0.473-3.65,2.932c0.812,2.375,2.578,4.979,5.252,4.611 c3.639-0.501,5.562,3.572,9.056,2.631c-0.24,0.524-0.481,1.048-0.722,1.572c0.742,6.383-0.486,12.499-2.763,18.404 c-0.562,1.454-0.404,4.408-2.846,3.724c-2.022-0.567-3.14-2.907-2.824-5.311c0.148-1.129,0.911-2.214,0.911-3.319 c0.001-3.531-1.866-6.278-5.096-7.179c-3.086-0.86-1.875,2.989-3.283,4.256c-2.145-2.577-3.758-5.019,1.452-7.16 c-2.542-0.483-3.981-0.882-5.445-1.005c-2.23-0.188-2.647-1.231-2.284-3.325c1.282-7.405-1.65-13.521-6.198-19.075 c2.156-1.774,1.301-6.25,3.312-6.599c6.697-1.161,5.164-7.793,8.353-11.122c0.338-0.352,0.425-1.538,0.138-1.801 c-2.554-2.342-5.741-3.213-9.102-3.312c-2.644-0.077-3.973,1.397-4.914,3.965c-2.332,6.362-2.154,12.557,0.152,18.808 c-3.15,2.464-5.736,5.906-5.915,9.532c-0.257,5.199-0.444,10.979,5.595,14.259c2.357,1.28,2.662,8.418,0.967,10.573 c-2.669,3.395-5.222,1.069-7.776-0.256c0.677-1.987,4.624-0.748,3.981-4.028c-0.646-3.307-1.777-6.353-4.546-8.543 c-1.37-1.084-2.339-1.158-3.715,0.323c-3.75,4.037-3.805,5.095,0.254,9.353c0.403,0.424,0.465,1.173,0.686,1.771 c-1.07-0.54-2.771-1.08-2.925,0.29c-0.62,5.532-3.812,4.3-7.592,3.785c-7.826-1.065-13.48-5.325-15.919-12.968 c-2.45,0.373-4.934,0.604-7.338,1.173c-1.714,0.405-2.995,1.51-2.625,3.61c0.647,3.678,0.651,3.677-1.005,6.893 c-1.955-4.929-5.421-6.492-10.386-5.635c-2.611,0.451-5.318-0.204-7.634-1.759c-0.96-0.645-2.185-1.304-1.956-2.636 c0.186-1.088,1.413-1.325,2.376-1.444c2.516-0.311,2.415-1.773,1.691-3.563c-0.9-2.229-2.152-4.38-4.638-4.792 c-3.275-0.543-5.298-2.483-7.181-4.92c-1.078-1.395-2.079-3.118-4.31-2.881c-0.878,4.661-4.345,8.771-2.981,13.907 c0.656,0.015,0.933,0.406,1,1.005c0.909,0.38,1.226,1.058,1.002,2.005c1.369-0.322,1.364,0.936,1.838,1.641 c2.514,5.537,6.676,9.961,10.106,14.877c1.739,2.494,3.438,6.486,6.033,6.543c6.594,0.146,8.421,5.522,12.042,8.966 c0.853-0.049,1.936-0.546,1.977,0.987c2.584-0.18,4.631,0.714,5.981,2.994c0.933-0.185,1.875-0.387,2.022,0.989 c1.229-0.342,2.333-0.324,2.99,1.015c0.911-0.154,1.667,0.002,2.004,0.995c0.616,0.013,0.896,0.362,0.92,0.963 c0.94,1.597,3.338,1.652,3.881,3.669c0.247,9.082-1.865,17.977-2.153,27.02c-0.11,3.448-0.444,6.891-0.677,10.335 c0.302,0.1,0.605,0.195,0.91,0.286c3.748,1.17,8.228-0.915,11.456,2.575c1.329,0.073,2.657,0.146,3.985,0.22 c4.547-0.006,9.094-0.011,13.64-0.016c1.733-9.856,5.648-18.387,14.646-23.743c1.439-0.857,2.49-2.005,2.201-3.572 c-0.783-4.239,2.509-5.476,5.146-6.447c5.186-1.91,8.833-5.983,8.376-11.207c-0.293-3.353,1.449-5.222,3.624-7.06 c-0.247-1.676-0.495-3.353-0.788-5.34c1.314,0.193,2.246,0.077,2.87,0.462c4.133,2.551,7.56-0.135,10.443-2.077 c3.194-2.151,3.506-6.048,2.78-9.916c-0.623-3.32-5.057-6.609-0.325-10.154c0.164-0.123-0.222-0.915-0.275-1.403 c-0.627-5.651-5.213-6.976-9.46-8.671c0.586-1.526,1.926-0.944,2.996-1.042c4.446-0.406,9.523,0.428,13.18-1.477 c4.2-2.187,6.295,0.922,6.079,2.346c-0.658,4.331,2.592,2.01,3.686,2.646c0.641,1.607-1.812,2.326-0.377,4.124 c3.675-3.022,5.966-0.348,8.317,2.244c0.779,0.86,1.711,1.582,2.533,2.406c5.223,5.226,5.465,7.392,1.662,13.862 c-1.105,1.88-2.455,4.018-0.414,5.888c3.102,2.841,1.396,3.758-1.363,4.981c-1.939,0.858-3.836,0.957-5.826,0.938 c-3.037-0.028-5.062,1.146-5.632,4.368c-0.412,2.326-1.233,4.854,1.442,6.203c2.576,1.301,5.375,1.881,7.84-0.576 c1.775-1.771,4.082-2.728,6.391-1.854c3.98,1.504,8.684,2.251,9.828,7.639c0.32,1.513,1.918,2.51,3.336,2.766 c5.998,1.086,11.289,4.962,17.678,4.45c1.762-0.142,4.193,1.617,4.969-1.367c0.705-2.711-1.518-3.703-3.436-4.794 c-2.965-1.687-6.432-2.584-8.957-5.458c4.461-0.947,7.447,2.192,11.059,3.18c2.545,0.694,3.777,0.427,3.828-2.489 C302.061,196.728,302.076,193.79,299.365,191.281z M120.851,144.296 c2.778,1.661,5.852,3.246,5.828,6.851c-0.022,3.357,1.751,3.824,4.288,3.942c5.667,0.264,11.284,0.44,16.626-2.145 c2.771-1.341,2.89-1.155,3.4,2.015c1.454-1.462,2.215,0.281,3.117,0.82c1.864,1.113,3.674,2.257,5.915,2.416 c4.27,0.304,5.775-1.587,4.37-5.573c-0.275-0.781-0.76-1.481-0.106-2.279c1.382-0.278,3.116,1.312,4.12-0.344 c0.971-1.602-0.007-3.312-1.024-4.578c-1.341-1.667-3.021-3.059-4.536-4.588c-1.282-1.296-3.297-2.77-2.777-4.476 c2.149-7.067-3.035-14.849,2.356-21.611c1.308-1.64,0.433-3.911-1.041-5.469c-1.168-1.236-2.81-1.405-4.08-0.357 c-3.488,2.879-7.884,5.363-6.131,11.158c1.091,2.132,0.865,4.206-1.138,6.317c0-2.102,0-4.204,0.001-6.305 c-0.543-1.383-0.778-3.035-1.697-4.094c-1.634-1.88-2.527-1.149-2.35,1.181c-1.292,7.053-3.274,13.923-5.391,20.766 c-0.512,1.653-0.406,2.727-2.966,2.515c-6.109-0.509-11.717-2.556-17.405-4.47C116.535,138.245,116.731,141.834,120.851,144.296z M201.228,103.898 c4.934-0.035,9.73,2.035,14.692,0.842c2.972-0.715,5.838-2.396,8.56-0.835c4.563-0.111,6.528-2.13,6.52-6.241 c-0.013-6.408-6.984-9.825-13.143-6.442c-7.748,4.257-12.648,2.444-15.354-5.613c-0.671-2-1.086-4.523-3.985-4.326 c-2.258,0.153-3.536-0.996-5.11-2.335c-1.953-1.661-5.145-2.68-6.696-0.39c-1.779,2.626,0.636,4.871,2.969,6.417 c0.545,0.361,1.207,0.771,1.817,0.773c4.711,0.021,5.096,3.305,5.226,6.795c0.073,1.994,0.239,3.997,0.122,5.982 C196.654,101.752,198.091,103.921,201.228,103.898z M238.796,202.718 c-1.538-0.181-2.831-0.401-3.608-2.055c-3.019-6.426-11.014-7.099-14.867-12.647c-0.245-0.354-1.486-0.016-2.306,0.03 c-0.481,2.918-1.897,6.101-1.169,8.676c1.267,4.478-6.562,11.041,2.961,13.546c0.085,0.022,0.117,0.295,0.15,0.455 c0.762,3.711,2.961,1.996,4.321,0.823c1.462-1.26,2.525-3.073,3.488-4.799c1.403-2.511,2.675-3.386,4.497-0.387 c1.398,2.303,3.787,1.657,5.881,1.733c1.648,0.059,3.099-0.566,3.296-2.358C241.633,203.986,240.497,202.918,238.796,202.718z M173.586,133.484 c0.778,2.479,2.649,3.291,5.407,1.3c6.105-4.409,6.896-6.692,3.541-13.251c-0.646-1.262-1.432-2.165-0.622-4.003 c2.515-5.7,1.936-6.447-3.915-6.752c-6.838-0.356-7.105-0.015-4.739,6.69c0.357,1.013,0.671,1.854-0.123,2.732 c-0.505,0.559-1.071,0.669-1.742,0.257c-1.189-0.73-2.364-2.274-3.693-0.191c-1.294,2.028-0.67,3.864,0.79,5.434 C170.639,128.013,172.582,130.29,173.586,133.484z M178.574,97.065 c1.985,1.887,4.778,1.786,4.871-2.358c0.053-2.324,0.389-4.643,0.6-6.966c0.003-1.499,0.348-3.099-0.065-4.472 c-1.006-3.349-3.91-2.393-6.254-2.18c-1.403,0.127-3.129,0.521-2.718,2.706c0.27,1.429,3.579,2.41,1.357,3.879 c-1.548,1.023-2.876-1.685-4.325-2.697c-0.65-0.455-1.445-0.959-2.185-0.976c-1.372-0.029-2.327,0.562-1.386,2.163 C171.036,90.529,175.004,93.672,178.574,97.065z M158.6,96.013 c3.837,0.504,5.386-2.157,5.706-5.39c0.237-2.401,1.137-5.755-3.309-5.479c-1.969,0.122-2.163-1.008-2.083-2.479 c0.063-1.157,0.244-2.32,0.172-3.469c-0.075-1.203,0.545-3.034-1.304-3.215c-1.342-0.131-1.472,1.503-1.892,2.561 c-1.211,3.055-0.972,6.56-2.928,9.377c0.028,2.236-2.196,3.771-1.895,6.092C153.576,94.7,156.046,95.677,158.6,96.013z M171.111,61.536 c-0.062,0.373,0.839,1.311,1.282,1.304c3.347-0.055,5.376,2.027,7.466,4.177c0.487,0.502,1.511,0.77,2.234,0.687 c1.047-0.119,0.871-1.192,0.682-1.822c0.785-7.328-3.808-11.484-8.742-15.424c-1.503-1.2-3.87-0.395-3.395,0.742 C172.117,54.741,171.7,58.05,171.111,61.536z M188.316,72.18 c-0.03,0.3,0.615,0.755,1.029,0.996c1.359,0.791,2.8,1.071,4.261,0.277c1.162-0.63,1.726-1.737,1.319-2.932 c-0.794-2.333-3.136-1.274-5.054-2.014c3.594-4.158,2.333-8.493-2.537-10.142c-1.904-0.645-2.917,0.033-3.231,1.84 C183.279,64.944,188.789,67.506,188.316,72.18z M185.9,98.053 c0.229,3.146,3.097,4.614,5.95,4.986c2.93,0.383,2.726-2.146,2.956-4.263c-0.676-2.349,0.204-6.014-4.083-5.919 C187.562,92.928,185.694,95.232,185.9,98.053z M250.248,172.002 c3.289,0.032,4.678-2.088,4.627-5.222c-0.041-2.543-0.092-5.625-3.342-5.705c-3.747-0.093-3.846,3.417-4.474,6.137 C247.51,169.268,247.176,171.973,250.248,172.002z M232.065,213.343 c-2.694,0.434-4.508,2.032-4.719,4.87c-0.143,1.912,1.396,1.871,2.938,1.885c2.688-0.479,4.842-2.101,5.132-4.954 C235.596,213.383,233.511,213.11,232.065,213.343z M245.171,217.064 c-2.108,0.283-2.384,2.081-2.449,3.772c-0.057,1.479,0.706,2.963,2.235,2.595c1.814-0.438,1.946-2.414,2.123-4.027 C247.038,218.09,246.725,216.855,245.171,217.064z"} ] var width = "100%", height = "100%"; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .attr("viewBox", "0 0 405 400") .append("g"); var path = svg.selectAll("path") .data(states) .enter() .append("path") .attr("d", function(d){ return d.path }) .on("mouseover", function(d) { d3.select(this).classed('active',true); }) .on("mouseout", function(d) { d3.select(this).classed('active',false); }) .on("click" , function(d){ alert(d.state) }); </script> </body> </html>
Modified
http://d3js.org/d3.v3.min.js
to a secure url
https://d3js.org/d3.v3.min.js