<commit_before>import * as jquery from "jquery";
import * as ol from "openlayers";
import * as _ from "lodash";
import AbstractGlyphLayer from "./AbstractGlyphLayer";
import AbstractFeatureLayer from "./AbstractFeatureLayer";
import ImageGlyphCache from "./ImageGlyphCache";
import AbstractLayer from "./AbstractLayer";

// loads jquery from the es6 default module.
var $:JQueryStatic = (jquery as any)["default"];

import DynamicColumn = weavejs.data.column.DynamicColumn;
import AlwaysDefinedColumn = weavejs.data.column.AlwaysDefinedColumn;
import IAttributeColumn = weavejs.api.data.IAttributeColumn;
import IQualifiedKey = weavejs.api.data.IQualifiedKey;

export default class ImageGlyphLayer extends AbstractGlyphLayer
{
	private imageGlyphCache:ImageGlyphCache;

	imageSize = Weave.linkableChild(this, AlwaysDefinedColumn);
	imageURL = Weave.linkableChild(this, AlwaysDefinedColumn);
	dataAlpha = Weave.linkableChild(this, new AlwaysDefinedColumn(1.0));
	dataColor = Weave.linkableChild(this, AlwaysDefinedColumn);

	get selectableAttributes()
	{
		return super.selectableAttributes
			.set("Image Size", this.imageSize)
			.set("Image URL", this.imageURL)
//			.set("Image Alpha", this.dataAlpha)
			.set("Image Tint", this.dataColor);
	}

	protected getRequiredAttributes() {
		return super.getRequiredAttributes().concat([this.imageURL]);
	}

	constructor()
	{
		super();
		this.imageGlyphCache = new ImageGlyphCache(this);
		this.dataAlpha.defaultValue.state = 1.0;
	}

	onLayerReady()
	{
		super.onLayerReady();

		this.imageSize.addGroupedCallback(this, this.updateStyleData);
		this.imageURL.addGroupedCallback(this, this.updateStyleData);
		this.dataAlpha.addGroupedCallback(this, this.updateStyleData);
		this.dataColor.addGroupedCallback(this, this.updateStyleData, true);
	}

	getToolTipColumns(): IAttributeColumn[] 
	{
		let additionalColumns: IAttributeColumn[] = [];

		for (let column of [this.imageSize, this.imageURL, this.dataAlpha, this.dataColor])
		{
			let internalColumn = weavejs.data.ColumnUtils.hack_findInternalDynamicColumn(column);
			if (internalColumn)
				additionalColumns.push(internalColumn);
		}<commit_msg>temporary fix on imageGlyphPlotter not rendering glyphs<commit_after>import * as jquery from "jquery";
import * as ol from "openlayers";
import * as _ from "lodash";
import AbstractGlyphLayer from "./AbstractGlyphLayer";
import AbstractFeatureLayer from "./AbstractFeatureLayer";
import ImageGlyphCache from "./ImageGlyphCache";
import AbstractLayer from "./AbstractLayer";

// loads jquery from the es6 default module.
var $:JQueryStatic = (jquery as any)["default"];

import DynamicColumn = weavejs.data.column.DynamicColumn;
import AlwaysDefinedColumn = weavejs.data.column.AlwaysDefinedColumn;
import IAttributeColumn = weavejs.api.data.IAttributeColumn;
import IQualifiedKey = weavejs.api.data.IQualifiedKey;

export default class ImageGlyphLayer extends AbstractGlyphLayer
{
	private imageGlyphCache:ImageGlyphCache;

	imageSize = Weave.linkableChild(this, AlwaysDefinedColumn);
	imageURL = Weave.linkableChild(this, AlwaysDefinedColumn);
	dataAlpha = Weave.linkableChild(this, new AlwaysDefinedColumn(1.0));
	dataColor = Weave.linkableChild(this, AlwaysDefinedColumn);

	get selectableAttributes()
	{
		return super.selectableAttributes
			.set("Image Size", this.imageSize)
			.set("Image URL", this.imageURL)
//			.set("Image Alpha", this.dataAlpha)
			.set("Image Tint", this.dataColor);
	}

	// protected getRequiredAttributes() {
	// 	return super.getRequiredAttributes().concat([this.imageURL]);
	// }

	constructor()
	{
		super();
		this.imageGlyphCache = new ImageGlyphCache(this);
		this.dataAlpha.defaultValue.state = 1.0;
	}

	onLayerReady()
	{
		super.onLayerReady();

		this.imageSize.addGroupedCallback(this, this.updateStyleData);
		this.imageURL.addGroupedCallback(this, this.updateStyleData);
		this.dataAlpha.addGroupedCallback(this, this.updateStyleData);
		this.dataColor.addGroupedCallback(this, this.updateStyleData, true);
	}

	getToolTipColumns(): IAttributeColumn[] 
	{
		let additionalColumns: IAttributeColumn[] = [];

		for (let column of [this.imageSize, this.imageURL, this.dataAlpha, this.dataColor])
		{
			let internalColumn = weavejs.data.ColumnUtils.hack_findInternalDynamicColumn(column);
			if (internalColumn)
				additionalColumns.push(internalColumn);
		}
{'fraction_non_alphanumeric': 0.11256604640477831, 'fraction_numerical': 0.002297266253158741, 'mean_word_length': 5.845911949685535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '974876', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1316, 'n_words': 270}