Esri / cedar

JavaScript Charts for ArcGIS
https://esri.github.io/cedar
258 stars 238 forks source link

use unpkg instead of github pages as default resource location. #459

Closed jgravois closed 5 years ago

jgravois commented 5 years ago

this patch certainly couldn't hurt anything. but it did not alter the broken behavior i witnessed in my own simple webpack app.

whether i installed 0.9.2 or npm linked this branch, it always failed to fetch resources from the local bundle, not gh-pages (unless of course i set baseUrl within the app).

this was true for both production builds and when using webpack-dev-server.

//src/index.js

import Cedar from "arcgis-cedar";

var chart = new Cedar({
  "type":"scatter",
  "dataset":{
    "url":"https://services.arcgis.com/uDTUpUPbk8X8mXwl/arcgis/rest/services/Public_Schools_in_Onondaga_County/FeatureServer/0",
    "query":{},
    "mappings":{
      "x": {"field":"Number_of","label":"Student Enrollment (2008)"},
      "y": {"field":"F_of_teach","label":"Fraction of Teachers"},
      "color":{"field":"Type","label":"Facility Type"}
    }
  },
  // "baseUrl": "http://unpkg.com/arcgis-cedar/dist"
});

chart.tooltip = {
  "title": "{NAME}",
  "content": "{Number_of} students with a {Number_of} student Number_of."
}

chart.show({
  elementId: "#chart",
  autolabels: true
});