WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@w4
Copy link

@w4 w4 commented May 10, 2017

No description provided.

@w4
Copy link
Author

w4 commented May 11, 2017

If this is affecting anyone else (ie. anyone using CommonJS and the dataUrl config prop), the easiest fix is a monkeypatch.

import * as Datamap from 'datamaps';

...

const originalDraw = Datamap.prototype.draw;
const originalUpdateChoropleth = Datamap.prototype.updateChoropleth;

Datamap.prototype.draw = function () {
    window['Datamaps'] = Datamap;
    originalDraw.call(this);
};

Datamap.prototype.updateChoropleth = function (data, options) {
    delete window['Datamaps'];
    originalUpdateChoropleth.call(this, data, options);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant