<commit_before><?xml version="1.0" encoding="utf-8"?>
<!--
/*
    Weave (Web-based Analysis and Visualization Environment)
    Copyright (C) 2008-2011 University of Massachusetts Lowell

    This file is a part of Weave.

    Weave is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License, Version 3,
    as published by the Free Software Foundation.

    Weave is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
*/
-->
<SliderTool
	xmlns="weave.visualization.tools.*" 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:ui="weave.ui.*"
	xmlns:settings="weave.ui.settings.*"
	xmlns:LinkableObjectList="weave.ui.LinkableObjectList.*"
	verticalScrollPolicy="off"
	width="400" 
	title="Dimension Slider Tool"
	height="40">

<mx:Script>
		<![CDATA[
			import weave.Weave;
			import weave.api.WeaveAPI;
			import weave.api.data.IDataSource;
			import weave.core.SessionManager;
			import weave.core.weave_internal;
			import weave.data.AttributeColumns.ProxyColumn;
			import weave.data.AttributeColumns.SecondaryKeyNumColumn;
			import weave.data.ColumnReferences.HierarchyColumnReference;
			import weave.utils.HierarchyUtils;
            use namespace weave_internal;

	//constructor
	
	override protected function constructor():void
	{
		super.constructor();
	}
	override public function dispose():void
	{
		super.dispose();
		SecondaryKeyNumColumn.secondaryKeyFilter.value = null;
	}
	
	//class data

	private var values:Array = [];
	
	//overrides of abstract SliderTool functions
	
	/**
	 * This function gets called after children have been created
	 */ 
	override protected function childrenCreated():void
	{
		super.childrenCreated();
		if (dimsLabel != null)
			dimsLabel.text = "Replace labels with values from a dimension with a secondary key:";
		
		SecondaryKeyNumColumn.secondaryKeyFilter.addGroupedCallback(this, handleSliderChange, true);
	}

	/**
	 * This function finds a list of attribute tags in the same attribute hierarchy
	 * that have the same @dataTableName and @name attributes, then returns a list of
	 * their @year values.
	 * @param ref A reference to an attribute tag in an AttributeHierarchy.
	 * @return An Array of @year values that the referenced column is defined for.
	 */
	override protected function getValuesFromColHier(ref:HierarchyColumnReference):Array
	{
		var dimensionColumn:ProxyColumn = WeaveAPI.AttributeColumnCache.getColumn(ref) as ProxyColumn;
		if (dimensionColumn && dimensionColumn.internalColumn)
			addToListOfDims(ref);
		return SecondaryKeyNumColumn.secondaryKeys;<commit_msg>Added static function to DimensionSliderTool to get the current value.<commit_after><?xml version="1.0" encoding="utf-8"?>
<!--
/*
    Weave (Web-based Analysis and Visualization Environment)
    Copyright (C) 2008-2011 University of Massachusetts Lowell

    This file is a part of Weave.

    Weave is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License, Version 3,
    as published by the Free Software Foundation.

    Weave is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
*/
-->
<SliderTool
	xmlns="weave.visualization.tools.*" 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:ui="weave.ui.*"
	xmlns:settings="weave.ui.settings.*"
	xmlns:LinkableObjectList="weave.ui.LinkableObjectList.*"
	verticalScrollPolicy="off"
	width="400" 
	title="Dimension Slider Tool"
	height="40">

<mx:Script>
		<![CDATA[
			import weave.Weave;
			import weave.api.WeaveAPI;
			import weave.api.data.IDataSource;
			import weave.core.SessionManager;
			import weave.core.weave_internal;
			import weave.data.AttributeColumns.ProxyColumn;
			import weave.data.AttributeColumns.SecondaryKeyNumColumn;
			import weave.data.ColumnReferences.HierarchyColumnReference;
			import weave.utils.HierarchyUtils;
            use namespace weave_internal;

	//constructor
	
	override protected function constructor():void
	{
		super.constructor();
	}
	override public function dispose():void
	{
		super.dispose();
		SecondaryKeyNumColumn.secondaryKeyFilter.value = null;
	}
	
	public static function get dimensionSliderValue():String
	{
		return SecondaryKeyNumColumn.secondaryKeyFilter.value;
	}
			
	//class data

	private var values:Array = [];
	
	//overrides of abstract SliderTool functions
	
	/**
	 * This function gets called after children have been created
	 */ 
	override protected function childrenCreated():void
	{
		super.childrenCreated();
		if (dimsLabel != null)
			dimsLabel.text = "Replace labels with values from a dimension with a secondary key:";
		
		SecondaryKeyNumColumn.secondaryKeyFilter.addGroupedCallback(this, handleSliderChange, true);
	}

	/**
	 * This function finds a list of attribute tags in the same attribute hierarchy
	 * that have the same @dataTableName and @name attributes, then returns a list of
	 * their @year values.
	 * @param ref A reference to an attribute tag in an AttributeHierarchy.
	 * @return An Array of @year values that the referenced column is defined for.
	 */
	override protected function getValuesFromColHier(ref:HierarchyColumnReference):Array
	{
		var dimensionColumn:ProxyColumn = WeaveAPI.AttributeColumnCache.getColumn(ref) as ProxyColumn;
		if (dimensionColumn && dimensionColumn.internalColumn)
			addToListOfDims(ref);
		return SecondaryKeyNumColumn.secondaryKeys;
{'fraction_non_alphanumeric': 0.08622414943295531, 'fraction_numerical': 0.007004669779853236, 'mean_word_length': 4.219321148825065, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 2, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 14}, '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': '1371190', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1665, 'n_words': 547}