class_docstr: Configure tooltips.
  
  Notes
  -----
  Set tooltips='none' to hide tooltips from this layer.
  
  Examples
  --------
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 15
  
      import numpy as np
      from lets_plot import *
      LetsPlot.setup_html()
      n = 100
      np.random.seed(42)
      data = {
          'id': np.arange(n),
          'x': np.random.normal(size=n),
          'y': np.random.normal(size=n),
          'c': np.random.choice(['a', 'b'], size=n),
          'w': np.random.randint(1, 11, size=n)
      }
      ggplot(data, aes('x', 'y')) + \
          geom_point(aes(color='c', size='w'), \
                     tooltips=layer_tooltips().line('@c "@id"')
                                              .line('---')
                                              .format('@y', '.2f')
                                              .line('(x, y)|(^x, @y)')
                                              .line('@|@w')) + \
          scale_size(range=[2, 4])
  
  |
  
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 12
  
      import numpy as np
      from lets_plot import *
      LetsPlot.setup_html()
      n = 100
      np.random.seed(42)
      data = {
          'x': np.random.normal(size=n),
          'y': np.random.normal(size=n),
          'c': np.random.randint(10, size=n)
      }
      ggplot(data, aes('x', 'y')) + \
          geom_point(aes(color='c'), tooltips='none')
class_docstr_tok: ["Configure","tooltips",".","Notes","--","--","-","Set","tooltips='none","'","to","hide","tooltips","from","this","layer",".","Examples","--","--","--","--","..","jupyter-execute",":",":",":","linenos",":",":","emphasize-lines",":","15","import","numpy","as","np","from","lets_plot","import","*","LetsPlot.setup_html","(",")","n","=","100","np.random.seed","(","42",")","data","=","{","'id","'",":","np.arange","(","n",")",",","'","x","'",":","np.random.normal","(","size=n",")",",","'","y","'",":","np.random.normal","(","size=n",")",",","'","c","'",":","np.random.choice","(","[","'","a","'",",","'","b","'","]",",","size=n",")",",","'","w","'",":","np.random.randint","(","1",",","11",",","size=n",")","}","ggplot","(","data",",","aes","(","'","x","'",",","'","y","'",")",")","+","\\","geom_point","(","aes","(","color=","'","c","'",",","size=","'","w","'",")",",","\\","tooltips=layer_tooltips","(",")",".line","(","'","@","c","``","@","id","''","'",")",".line","(","'","--","-","'",")",".format","(","'","@","y","'",",","'.2f","'",")",".line","(","'","(","x",",","y",")","|","(","^x",",","@","y",")","'",")",".line","(","'","@","|","@","w","'",")",")","+","\\","scale_size","(","range=","[","2",",","4","]",")","|","..","jupyter-execute",":",":",":","linenos",":",":","emphasize-lines",":","12","import","numpy","as","np","from","lets_plot","import","*","LetsPlot.setup_html","(",")","n","=","100","np.random.seed","(","42",")","data","=","{","'","x","'",":","np.random.normal","(","size=n",")",",","'","y","'",":","np.random.normal","(","size=n",")",",","'","c","'",":","np.random.randint","(","10",",","size=n",")","}","ggplot","(","data",",","aes","(","'","x","'",",","'","y","'",")",")","+","\\","geom_point","(","aes","(","color=","'","c","'",")",",","tooltips='none","'",")"]
docstr: Line to show in the tooltip.
  Add a line template to the tooltip with a label.
  
  Parameters
  ----------
  value : str
      Enriched string which becomes one line of the tooltip.
  
  Returns
  -------
  `layer_tooltips`
      Layer tooltips specification.
  
  Notes
  -----
  Variables and aesthetics can be accessed via special syntax:
  
  - ^color for aes,
  - @x for variable,
  - @{x + 1} for variable with spaces in the name,
  - @{x^2 + 1} for variable with spaces and '^' symbol in the name,
  - @x^2 for variable with '^' symbol in its name.
  
  A '^' symbol can be escaped with a backslash, a brace character
  in the literal text - by doubling:
  
  - 'x\^2' -> "x^2"
  - '{{x}}' -> "{x}"
  
  The specified 'line' for side tooltip will move it to the general multi-line tooltip.
  The default tooltip has a label before the value,
  usually containing the name of the mapped variable.
  It has its own behaviour, like blank label for axis aesthetics.
  This default label can be set in template using a pair of symbols '@|'.
  The label can be overridden by specifying a string value before '|' symbol.
  Within the tooltip line the label is left-aligned,
  the string formed by template is right-aligned.
  If a label is not specified, the string will be centered in the tooltip.
  
  Examples
  --------
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 12, 14
  
      import numpy as np
      from lets_plot import *
      LetsPlot.setup_html()
      n = 100
      np.random.seed(42)
      x = np.linspace(-3, 3, n)
      y = 9 - x ** 2 + np.random.normal(scale=.3, size=n)
      data = {'x': x, '9 - x^2': y}
      ggplot(data) + \
          geom_point(aes('x', '9 - x^2'), \
                     tooltips=layer_tooltips().format('x', '.3f')\
                                              .line('x = @x')\
                                              .format('9 - x^2', '.3f')\
                                              .line('9 - x\^2 = @{9 - x^2}'))
  
  |
  
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 17-20
  
      import numpy as np
      from lets_plot import *
      LetsPlot.setup_html()
      n = 100
      np.random.seed(42)
      data = {
          'x': np.random.normal(size=n),
          'y': np.random.normal(size=n),
          'c': np.random.choice(['X', 'Y'], size=n),
          'p': np.random.uniform(size=n),
          'w': np.random.randint(100, size=n)
      }
      ggplot(data, aes('x', 'y')) + \
          geom_point(aes(shape='c', size='w', color='p'), show_legend=False, \
                     tooltips=layer_tooltips().format('x', '.2f')\
                                              .format('y', '.2f')\
                                              .line('(^x, ^y)')\
                                              .line('|^shape')\
                                              .line('@|^color')\
                                              .line('w|^size')) + \
          scale_size(range=[2, 4])
docstr_tok: ["Line","to","show","in","the","tooltip",".","Add","a","line","template","to","the","tooltip","with","a","label",".","Parameters","--","--","--","--","--","value",":","str","Enriched","string","which","becomes","one","line","of","the","tooltip",".","Returns","--","--","--","-","`","layer_tooltips","`","Layer","tooltips","specification",".","Notes","--","--","-","Variables","and","aesthetics","can","be","accessed","via","special","syntax",":","-","^color","for","aes",",","-","@","x","for","variable",",","-","@","{","x","+","1","}","for","variable","with","spaces","in","the","name",",","-","@","{","x^2","+","1","}","for","variable","with","spaces","and","'^","'","symbol","in","the","name",",","-","@","x^2","for","variable","with","'^","'","symbol","in","its","name",".","A","'^","'","symbol","can","be","escaped","with","a","backslash",",","a","brace","character","in","the","literal","text","-","by","doubling",":","-","'","x\\^2","'","-",">","``","x^2","''","-","'","{","{","x","}","}","'","-",">","``","{","x","}","''","The","specified","'line","'","for","side","tooltip","will","move","it","to","the","general","multi-line","tooltip",".","The","default","tooltip","has","a","label","before","the","value",",","usually","containing","the","name","of","the","mapped","variable",".","It","has","its","own","behaviour",",","like","blank","label","for","axis","aesthetics",".","This","default","label","can","be","set","in","template","using","a","pair","of","symbols","'","@","|","'",".","The","label","can","be","overridden","by","specifying","a","string","value","before","'|","'","symbol",".","Within","the","tooltip","line","the","label","is","left-aligned",",","the","string","formed","by","template","is","right-aligned",".","If","a","label","is","not","specified",",","the","string","will","be","centered","in","the","tooltip",".","Examples","--","--","--","--","..","jupyter-execute",":",":",":","linenos",":",":","emphasize-lines",":","12",",","14","import","numpy","as","np","from","lets_plot","import","*","LetsPlot.setup_html","(",")","n","=","100","np.random.seed","(","42",")","x","=","np.linspace","(","-3",",","3",",","n",")","y","=","9","-","x","*","*","2","+","np.random.normal","(","scale=.3",",","size=n",")","data","=","{","'","x","'",":","x",",","'","9","-","x^2","'",":","y","}","ggplot","(","data",")","+","\\","geom_point","(","aes","(","'","x","'",",","'","9","-","x^2","'",")",",","\\","tooltips=layer_tooltips","(",")",".format","(","'","x","'",",","'.3f","'",")","\\",".line","(","'","x","=","@","x","'",")","\\",".format","(","'","9","-","x^2","'",",","'.3f","'",")","\\",".line","(","'","9","-","x\\^2","=","@","{","9","-","x^2","}","'",")",")","|","..","jupyter-execute",":",":",":","linenos",":",":","emphasize-lines",":","17-20","import","numpy","as","np","from","lets_plot","import","*","LetsPlot.setup_html","(",")","n","=","100","np.random.seed","(","42",")","data","=","{","'","x","'",":","np.random.normal","(","size=n",")",",","'","y","'",":","np.random.normal","(","size=n",")",",","'","c","'",":","np.random.choice","(","[","'","X","'",",","'","Y","'","]",",","size=n",")",",","'","p","'",":","np.random.uniform","(","size=n",")",",","'","w","'",":","np.random.randint","(","100",",","size=n",")","}","ggplot","(","data",",","aes","(","'","x","'",",","'","y","'",")",")","+","\\","geom_point","(","aes","(","shape=","'","c","'",",","size=","'","w","'",",","color=","'","p","'",")",",","show_legend=False",",","\\","tooltips=layer_tooltips","(",")",".format","(","'","x","'",",","'.2f","'",")","\\",".format","(","'","y","'",",","'.2f","'",")","\\",".line","(","'","(","^x",",","^y",")","'",")","\\",".line","(","'|^shape","'",")","\\",".line","(","'","@","|^color","'",")","\\",".line","(","'","w|^size","'",")",")","+","\\","scale_size","(","range=","[","2",",","4","]",")"]
code: def line(self, value):
      """
          Line to show in the tooltip.
          Add a line template to the tooltip with a label.
  
          Parameters
          ----------
          value : str
              Enriched string which becomes one line of the tooltip.
  
          Returns
          -------
          `layer_tooltips`
              Layer tooltips specification.
  
          Notes
          -----
          Variables and aesthetics can be accessed via special syntax:
  
          - ^color for aes,
          - @x for variable,
          - @{x + 1} for variable with spaces in the name,
          - @{x^2 + 1} for variable with spaces and '^' symbol in the name,
          - @x^2 for variable with '^' symbol in its name.
  
          A '^' symbol can be escaped with a backslash, a brace character
          in the literal text - by doubling:
  
          - 'x\^2' -> "x^2"
          - '{{x}}' -> "{x}"
  
          The specified 'line' for side tooltip will move it to the general multi-line tooltip.
          The default tooltip has a label before the value,
          usually containing the name of the mapped variable.
          It has its own behaviour, like blank label for axis aesthetics.
          This default label can be set in template using a pair of symbols '@|'.
          The label can be overridden by specifying a string value before '|' symbol.
          Within the tooltip line the label is left-aligned,
          the string formed by template is right-aligned.
          If a label is not specified, the string will be centered in the tooltip.
  
          Examples
          --------
          .. jupyter-execute::
              :linenos:
              :emphasize-lines: 12, 14
  
              import numpy as np
              from lets_plot import *
              LetsPlot.setup_html()
              n = 100
              np.random.seed(42)
              x = np.linspace(-3, 3, n)
              y = 9 - x ** 2 + np.random.normal(scale=.3, size=n)
              data = {'x': x, '9 - x^2': y}
              ggplot(data) + \\
                  geom_point(aes('x', '9 - x^2'), \\
                             tooltips=layer_tooltips().format('x', '.3f')\\
                                                      .line('x = @x')\\
                                                      .format('9 - x^2', '.3f')\\
                                                      .line('9 - x\^2 = @{9 - x^2}'))
  
          |
  
          .. jupyter-execute::
              :linenos:
              :emphasize-lines: 17-20
  
              import numpy as np
              from lets_plot import *
              LetsPlot.setup_html()
              n = 100
              np.random.seed(42)
              data = {
                  'x': np.random.normal(size=n),
                  'y': np.random.normal(size=n),
                  'c': np.random.choice(['X', 'Y'], size=n),
                  'p': np.random.uniform(size=n),
                  'w': np.random.randint(100, size=n)
              }
              ggplot(data, aes('x', 'y')) + \\
                  geom_point(aes(shape='c', size='w', color='p'), show_legend=False, \\
                             tooltips=layer_tooltips().format('x', '.2f')\\
                                                      .format('y', '.2f')\\
                                                      .line('(^x, ^y)')\\
                                                      .line('|^shape')\\
                                                      .line('@|^color')\\
                                                      .line('w|^size')) + \\
                  scale_size(range=[2, 4])
  
          """
      if self._tooltip_lines is None:
          self._tooltip_lines = []
      self._tooltip_lines.append(value)
      return self
  
file_path: lets-plot/python-package/lets_plot/plot/tooltip.py
imports: from typing import List
  from lets_plot.plot.core import FeatureSpec, _filter_none
label_desc: Use image node_id 4 for calling the layer_tooltips obj's underlying member method code with example usage: obj.line(value) and returns: self