plottable 3.9.0-dev-74-g48541e02 → 3.9.0-dev-75-g48a03107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/components/legend.js +10 -2
- package/build/src/core/version.js +1 -1
- package/package.json +1 -1
- package/plottable.js +10 -2
- package/plottable.js.map +1 -1
|
@@ -211,12 +211,20 @@ var Legend = /** @class */ (function (_super) {
|
|
|
211
211
|
return _this;
|
|
212
212
|
}
|
|
213
213
|
Legend.prototype._setup = function () {
|
|
214
|
+
var _this = this;
|
|
214
215
|
_super.prototype._setup.call(this);
|
|
215
|
-
|
|
216
|
+
// Keep the row out of content() except while measuring, since renderImmediately() clears content()
|
|
217
|
+
var fakeLegendRow = d3.create("svg:g").classed(Legend.LEGEND_ROW_CLASS, true);
|
|
216
218
|
var fakeLegendEntry = fakeLegendRow.append("g").classed(Legend.LEGEND_ENTRY_CLASS, true);
|
|
217
219
|
fakeLegendEntry.append("text");
|
|
218
220
|
var context = new Typesettable.SvgContext(fakeLegendRow.node(), null, Configs.ADD_TITLE_ELEMENTS);
|
|
219
|
-
|
|
221
|
+
var ruler = context.createRuler();
|
|
222
|
+
this._measurer = new Typesettable.CacheMeasurer(function (text) {
|
|
223
|
+
_this.content().append(function () { return fakeLegendRow.node(); });
|
|
224
|
+
var dimensions = ruler(text);
|
|
225
|
+
fakeLegendRow.remove();
|
|
226
|
+
return dimensions;
|
|
227
|
+
});
|
|
220
228
|
this._wrapper = new Typesettable.Wrapper().maxLines(this.maxLinesPerEntry());
|
|
221
229
|
this._writer = new Typesettable.Writer(this._measurer, context, this._wrapper);
|
|
222
230
|
};
|
|
@@ -10,4 +10,4 @@ exports.version = void 0;
|
|
|
10
10
|
* real version number during the dist phase for for npm module publishing. Modifying this line should
|
|
11
11
|
* be accompanied by modifying the "sed-version" task in package.json accordingly.
|
|
12
12
|
*/
|
|
13
|
-
exports.version = "3.9.0-dev-
|
|
13
|
+
exports.version = "3.9.0-dev-75-g48a03107";
|
package/package.json
CHANGED
package/plottable.js
CHANGED
|
@@ -13250,12 +13250,20 @@ var Legend = /** @class */ (function (_super) {
|
|
|
13250
13250
|
return _this;
|
|
13251
13251
|
}
|
|
13252
13252
|
Legend.prototype._setup = function () {
|
|
13253
|
+
var _this = this;
|
|
13253
13254
|
_super.prototype._setup.call(this);
|
|
13254
|
-
|
|
13255
|
+
// Keep the row out of content() except while measuring, since renderImmediately() clears content()
|
|
13256
|
+
var fakeLegendRow = d3.create("svg:g").classed(Legend.LEGEND_ROW_CLASS, true);
|
|
13255
13257
|
var fakeLegendEntry = fakeLegendRow.append("g").classed(Legend.LEGEND_ENTRY_CLASS, true);
|
|
13256
13258
|
fakeLegendEntry.append("text");
|
|
13257
13259
|
var context = new Typesettable.SvgContext(fakeLegendRow.node(), null, Configs.ADD_TITLE_ELEMENTS);
|
|
13258
|
-
|
|
13260
|
+
var ruler = context.createRuler();
|
|
13261
|
+
this._measurer = new Typesettable.CacheMeasurer(function (text) {
|
|
13262
|
+
_this.content().append(function () { return fakeLegendRow.node(); });
|
|
13263
|
+
var dimensions = ruler(text);
|
|
13264
|
+
fakeLegendRow.remove();
|
|
13265
|
+
return dimensions;
|
|
13266
|
+
});
|
|
13259
13267
|
this._wrapper = new Typesettable.Wrapper().maxLines(this.maxLinesPerEntry());
|
|
13260
13268
|
this._writer = new Typesettable.Writer(this._measurer, context, this._wrapper);
|
|
13261
13269
|
};
|