Comments (29)
Are you using amd specific builds of d3/topojson?
from datamaps.
I'm using the libraries found here (which are the latest stable):
from datamaps.
I think you left off a url/src..
from datamaps.
I'm using the official latest stable libraries found here, downloaded locally:
d3 : https://github.com/mbostock/d3/blob/master/d3.js
topojson: https://github.com/mbostock/topojson/blob/master/topojson.js
Both claim to be AMD compliant, there is a bit in both that look like --
d3:
if (typeof define === "function" && define.amd) {
define(d3);
} else if (typeof module === "object" && module.exports) {
module.exports = d3;
} else {
this.d3 = d3;
}
....
topojson:
function noop() {}
if (typeof define === "function" && define.amd) define(topojson);
else if (typeof module === "object" && module.exports) module.exports = topojson;
else this.topojson = topojson;
}();
Sorry about that my post must have been sent a bit early
I've also tried various combinations of Shim vs. no Shim, etc.
from datamaps.
Can you update the path for datamaps to: 'http://rawgithub.com/markmarkoh/datamaps/amd-issues/dist/datamaps.all' and let me know if that fixes it for you?
from datamaps.
Wow yup! Fixed it quite well. Do you know what was the problem, just for future reference?
Thanks so much!
from datamaps.
Hi Mark,
I am also having trouble setting up Datamaps with require.js
I tried to follow your link, but it seems it does not work anymore or the content is removed?
Can you help me out ?
from datamaps.
Hi @Mafi78, the actual url is: https://raw.github.com/markmarkoh/datamaps/amd-issues/dist/datamaps.all.js
Let me know if that works and I'll send a pull request to get this in master.
from datamaps.
Hi Mark,
I got it up and running with your modification!
http://scn.sap.com/docs/DOC-52807
I think you can include it in your master.
Best regards and thank you!
Manfred
from datamaps.
Solves it for me too, thanks!
from datamaps.
Merged.
from datamaps.
this fixed it for me as well. I see this was merged, but was a release made with this? I used the file referenced in the getting started and I still had issues. thanks for the fix though.
from datamaps.
Yes there should have been a release on bower and the download links provided on the home page. How are you referencing the file?
from datamaps.
requirejs.config({
baseUrl: '/scripts',
paths : {
//jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min",
d3: "http://d3js.org/d3.v3.min",
topojson: "http://d3js.org/topojson.v1.min",
datamaps: "/scripts/datamaps.all.min",
dcc : "/scripts/dcc",
domReady : "/scripts/domReady"
}
});
And then when I load it
requirejs(["datamaps", "domReady!"],
function(datamap) {
var map = new datamap({element: document.getElementById('mapContainer')});
}
);
This works with the file posted here from the branch, not with the minified one I downloaded from the website. Note: although the filename is still min.js, I overwrote the contents with the one found in this post.
from datamaps.
When did you last edit /scripts/datamaps.all.min
?
from datamaps.
Today, it was the first time using it. I can replace the contents from the latest on github again if you think I picked up the latest file from a branch or an old tag, but I doubt it.
from datamaps.
It appears I'm having an issue with the min
files being deployed. The non-minified version should have the require changes. Give me a few minutes to figure out what the issue is with deploying.
Thanks for pointing this out!
from datamaps.
No worries @markmarkoh , great job with datamaps, thanks for taking a look at it.
from datamaps.
Thanks!
Can you try this file?
from datamaps.
I don't get a link from this file
:(
from datamaps.
Yikes, Can you try this file?
from datamaps.
one sec ;)
from datamaps.
@markmarkoh, I get this:
Uncaught Error: Module name "d3" has not been loaded yet for context: _
http://requirejs.org/docs/errors.html#notloaded
If I revert back to the file from this page it works like a charm. I named my d3 module d3
as seen above in paths, so I guess if datamaps is requiring it as d3
it should work.
from datamaps.
I'm having the same issue, @bitoiu. It happens with minimized versions only though. Right now as a workaround I require d3
globally (before anything else is loaded) and it works fine. Any ideas how to make it work properly, @markmarkoh?
from datamaps.
hi,
I'm trying to integrate datamaps into my project which use Browserify with NPM.
there are two problems:
require('datamaps');
wont work because your package.json file dont have "main" attribute, so adding:
"main": "dist/datamaps.all.js",
to datamaps/package.json fix it (but its a temp fix until you commit it)
the other problem which I cant figure how to fix is the same problem as in this bug, when doing:
var d3 = require('d3');
require('topojson');
require('datamaps');
I get the error: "Include d3.js (v3.0.3 or greater) and topojson on this page before creating a new map"
In the console watch i see that d3 is there, but topojson is undefined.
what can I do?
I tried with https://raw.githubusercontent.com/markmarkoh/datamaps/amd-issues/dist/datamaps.all.js
and with https://raw.githubusercontent.com/markmarkoh/datamaps/master/dist/datamaps.usa.min.js
but its giving the same error
thanks
from datamaps.
i found a quick ugly fix - adding
script src="http://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"> /script>
in the head tag fix the problem.
but i would really like to use require()...
from datamaps.
Please reopen this issue, it's not fixed yet.
I'm using latest versions of these modules, installed via npm and I still get the error
Uncaught Error: Include d3.js (v3.0.3 or greater) and topojson on this page before creating a new map
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected]
from datamaps.
Can you share the source of how you are loading up DataMaps? <script>
tags, require()
, import
, etc.
from datamaps.
Hi Mark
Can you help me with this issue:
I am using datamaps in conjunction with requirejs. I get an 'undefined' object when injecting the datamaps.world.min.js. I have also tried https://raw.githubusercontent.com/markmarkoh/datamaps/amd-issues/dist/datamaps.all.js.
If you look at the screenshot the other objects (topojson, d3, elasticsearch) are all found.
from datamaps.
Related Issues (20)
- Some of Countries missing in DataMap HOT 1
- I want to draw lines/paths on india map? Can someone please guide?
- get lat lng somehow from click event
- Missing Nantucket and Marthas Vineyard in Datampas.usa.js HOT 1
- Is it possible to change border colour of specific countries using updateChoropleth?
- Unrecognizable src script HOT 3
- Function to use custom map data HOT 1
- choropleth map color not updating when highlight on hover set to true
- React Native
- Custom-map-data-multi-layer example no longer works
- Text on bubbles
- Part of Russia is coming to the left of America HOT 1
- unable to import datamaps in angular app HOT 2
- How to have 2 maps using the same source, but with different information on hover tooltip? HOT 1
- Zoom to specified latitude and longitude
- Adding datamap to Vue 3
- `animationEnd` and `animationStart` as a configurable option for `map.arcConfig`
- rendering issues in safari 16.3
- Simple installation question
- Map for switzerland (swz?) not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datamaps.