示例#1
0
    /// <summary>
    /// Creates a ScatterplotMatrix with the chosen Scatterplots.
    /// </summary>
    /// <param name="scatterplotIndices">
    /// An array with the indeces of the chosen Scatterplots.
    /// </param>
    public void CreateScatterplotMatrix(int[] scatterplotIndices)
    {
        if (dataSource.IsLoaded)
        {
            if (null != scatterplotMatrix)
            {
                Destroy(scatterplotMatrix.gameObject);
            }

            int[,] dimCombinations = new int[scatterplotIndices.GetLength(0), 3];
            for (int i = 0; dimCombinations.GetLength(0) > i; ++i)
            {
                for (int j = 0; 3 > j; ++j)
                {
                    dimCombinations[i, j] = possibleScatterplots[scatterplotIndices[i], j];
                }
            }

            scatterplotMatrix = Instantiate(Resources.Load <GameObject>("Prefabs/ScatterplotMatrix"), transform)
                                .GetComponent <ScatterplotMatrix>();
            scatterplotMatrix.Initialize(dataSource, dimCombinations, pointSize);
            Debug.Log("ScatterplotMatrix was created.");
        }
        else
        {
            Debug.LogError("CSVDataSource was not loaded!");
        }
    }
示例#2
0
    /// <summary>
    /// This is called when the user selects the DataPoint.
    /// The call is delegated to the ScatterplotMatrix so that it
    /// can be forwarded to all the Scatterplots.
    /// This way if a DataPoint with a given index is selected, the
    /// same DataPoint in other Scatterplots are highlighted as well.
    /// </summary>
    public void selectDatapoint()
    {
        ScatterplotMatrix scatterplotMatrix = scatterplot.GetComponentInParent <ScatterplotMatrix>();

        scatterplotMatrix.SelectDataPoint(index);
    }
示例#3
0
    /// <summary>
    /// This is called when the user selects the DataPoint.
    /// The call is delegated to the ScatterplotMatrix so that it
    /// can be forwarded to all the Scatterplots.
    /// This way if a DataPoint with a given index is selected, the
    /// same DataPoint in other Scatterplots are highlighted as well.
    /// </summary>
    /// <param name="iSelection"></param>
    protected void VRAction(VRSelection iSelection)
    {
        ScatterplotMatrix scatterplotMatrix = scatterplot.GetComponentInParent <ScatterplotMatrix>();

        scatterplotMatrix.SelectDataPoint(index);
    }