MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / createLegacyDefinitionAdapter

Function createLegacyDefinitionAdapter

libs/htmlwidgets-1.5.3/htmlwidgets.js:878–901  ·  view source on GitHub ↗
(defn)

Source from the content-addressed store, hash-verified

876 // to rewrite all the logic in this file to accomodate both
877 // types of definitions.
878 function createLegacyDefinitionAdapter(defn) {
879 var result = {
880 name: defn.name,
881 type: defn.type,
882 initialize: function(el, width, height) {
883 return defn.factory(el, width, height);
884 },
885 renderValue: function(el, x, instance) {
886 return instance.renderValue(x);
887 },
888 resize: function(el, width, height, instance) {
889 return instance.resize(width, height);
890 }
891 };
892
893 if (defn.find)
894 result.find = defn.find;
895 if (defn.renderError)
896 result.renderError = defn.renderError;
897 if (defn.clearError)
898 result.clearError = defn.clearError;
899
900 return result;
901 }
902})();
903

Callers 1

htmlwidgets.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected