.. role:: ts-api-decorator

###############################
ScalarMapperContinuousPiecewise
###############################

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: ScalarMapperContinuousPiecewise

      Maps scalar values to texture coordinates/colors using a continuous/gradient style color map with
      multiple segments of independent gradients.

      This scalar mapper is configured much in the same way as the ScalarMapperFilledContours, but here
      you are allowed to specify a bottom and top color for each level/segment.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.constructor`



.. container:: api-index-section

   .. rubric:: Accessors

   .. rst-class:: api-index-list-item api-kind-accessor api-parent-kind-class

   * :js:attr:`~cee.ScalarMapperContinuousPiecewise.aboveRangeColor`
   * :js:attr:`~cee.ScalarMapperContinuousPiecewise.belowRangeColor`
   * :js:attr:`~cee.ScalarMapperContinuousPiecewise.rangeMaximum`
   * :js:attr:`~cee.ScalarMapperContinuousPiecewise.rangeMinimum`
   * :js:attr:`~cee.ScalarMapperContinuousPiecewise.undefinedColor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.createTexture`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.domainValue`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.mapToColor`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.mapToTextureCoordinate`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.normalizedValue`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.setup`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.tickValuesHint`
   * :js:meth:`~cee.ScalarMapperContinuousPiecewise.version`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.constructor()



      :rtype: ScalarMapperContinuousPiecewise



Accessors
=========

.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.aboveRangeColor()



      The color to assign values that are above the given range.

      Default is undefined, which indicates that the last color in the color array will be used.


      :rtype: Color4Like

   .. js:function:: ScalarMapperContinuousPiecewise.aboveRangeColor( color)

      :param color: None
      :type color: Color4Like


      :rtype: void



.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.belowRangeColor()



      The color to assign values that are below the given range.

      Default is null, which indicates that the first color in the color array will be used.


      :rtype: Color4Like

   .. js:function:: ScalarMapperContinuousPiecewise.belowRangeColor( color)

      :param color: None
      :type color: Color4Like


      :rtype: void



.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.rangeMaximum()



      The maximum range of the mapper


      :rtype: number



.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.rangeMinimum()



      The minimum range of the mapper


      :rtype: number



.. container:: ts-api-section

   .. js:function:: ScalarMapperContinuousPiecewise.undefinedColor()



      The color used for undefined values.


      :rtype: Color4Like

   .. js:function:: ScalarMapperContinuousPiecewise.undefinedColor( color)

      :param color: None
      :type color: Color4Like


      :rtype: void



Methods
=======

.. rst-class:: ts-api-section

createTexture
-------------

.. js:method:: ScalarMapperContinuousPiecewise.createTexture()



   Creates and returns texture for this scalar mapper


   :rtype: Texture

.. rst-class:: ts-api-section

domainValue
-----------

.. js:method:: ScalarMapperContinuousPiecewise.domainValue( normalizedPosition)

   :param normalizedPosition: None
   :type normalizedPosition: number


   Map normalized value (0 -> 1) into a domain value (range_min -> range_max)


   :rtype: number

.. rst-class:: ts-api-section

mapToColor
----------

.. js:method:: ScalarMapperContinuousPiecewise.mapToColor( scalarValue)

   :param scalarValue: None
   :type scalarValue: number


   Maps the given domain value to a color using the current range and color array.


   :rtype: Color4Like

.. rst-class:: ts-api-section

mapToTextureCoordinate
----------------------

.. js:method:: ScalarMapperContinuousPiecewise.mapToTextureCoordinate( scalarValue)

   :param scalarValue: None
   :type scalarValue: number


   Maps the given domain value to a color using the current range and color array.


   :rtype: Vec2Like

.. rst-class:: ts-api-section

normalizedValue
---------------

.. js:method:: ScalarMapperContinuousPiecewise.normalizedValue( domainValue)

   :param domainValue: None
   :type domainValue: number


   Map domain value (range_min -> range_max) into a normalized value (0 -> 1)


   :rtype: number

.. rst-class:: ts-api-section

setup
-----

.. js:method:: ScalarMapperContinuousPiecewise.setup( colorsFromToArray, tickValuesArray)

   :param colorsFromToArray: None
   :type colorsFromToArray: ArrayLike <Color4Like>
   :param tickValuesArray: None
   :type tickValuesArray: ArrayLike <number>


   Sets the scalar mapper from the given tick values array and colors from/to

   The tickValuesArray will contain the values separating each segment of the scalar mapper.
   The first value in tickValuesArray will be the min value of the scalar mapper, the last value
   will be the max value of the scalar mapper.

   The colorsFromToArray contains bottom and top colors for each of the segments. colorsFromToArray[0]
   is the bottom of the first segment, colorsFromToArray[1] is the top of the first segment.

   The colorsFromToArray.size must be 2*(tickValuesArray.length - 1)


   :rtype: void

.. rst-class:: ts-api-section

tickValuesHint
--------------

.. js:method:: ScalarMapperContinuousPiecewise.tickValuesHint()



   :rtype: ArrayLike <number>

.. rst-class:: ts-api-section

version
-------

.. js:method:: ScalarMapperContinuousPiecewise.version()



   :rtype: number

