superset/caravel/assets/visualizations/markup.js
Maxime Beauchemin a8fd23dfa4 Linting JSX files (#941)
`.jsx` linting is now in-scope for the `npm run lint` command, and
I linted the base files and some of the viz, there's still quite a bit
of work there, but that's a first pass on it.
2016-08-22 13:21:30 -07:00

23 lines
462 B
JavaScript

const $ = require('jquery');
require('./markup.css');
function markupWidget(slice) {
function refresh() {
$('#code').attr('rows', '15');
$.getJSON(slice.jsonEndpoint(), function (payload) {
slice.container.html(payload.data.html);
slice.done(payload);
})
.fail(function (xhr) {
slice.error(xhr.responseText, xhr);
});
}
return {
render: refresh,
resize: refresh,
};
}
module.exports = markupWidget;