##// END OF EJS Templates
Merge pull request #12727 from Carreau/doc-fix...
Matthias Bussonnier -
r26300:6760a46e merge
parent child Browse files
Show More
@@ -567,7 +567,7 b' class JSON(DisplayObject):'
567 Path to a local file to load the data from.
567 Path to a local file to load the data from.
568 expanded : boolean
568 expanded : boolean
569 Metadata to control whether a JSON display component is expanded.
569 Metadata to control whether a JSON display component is expanded.
570 metadata: dict
570 metadata : dict
571 Specify extra metadata to attach to the json display object.
571 Specify extra metadata to attach to the json display object.
572 root : str
572 root : str
573 The name of the root element of the JSON tree
573 The name of the root element of the JSON tree
@@ -651,12 +651,11 b' class GeoJSON(JSON):'
651 A URL to download the data from.
651 A URL to download the data from.
652 filename : unicode
652 filename : unicode
653 Path to a local file to load the data from.
653 Path to a local file to load the data from.
654 metadata: dict
654 metadata : dict
655 Specify extra metadata to attach to the json display object.
655 Specify extra metadata to attach to the json display object.
656
656
657 Examples
657 Examples
658 --------
658 --------
659
660 The following will display an interactive map of Mars with a point of
659 The following will display an interactive map of Mars with a point of
661 interest on frontend that do support GeoJSON display.
660 interest on frontend that do support GeoJSON display.
662
661
@@ -723,7 +722,7 b' class Javascript(TextDisplayObject):'
723 running the source code. The full URLs of the libraries should
722 running the source code. The full URLs of the libraries should
724 be given. A single Javascript library URL can also be given as a
723 be given. A single Javascript library URL can also be given as a
725 string.
724 string.
726 css: : list or str
725 css : list or str
727 A sequence of css files to load before running the source code.
726 A sequence of css files to load before running the source code.
728 The full URLs of the css files should be given. A single css URL
727 The full URLs of the css files should be given. A single css URL
729 can also be given as a string.
728 can also be given as a string.
@@ -844,25 +843,33 b' class Image(DisplayObject):'
844 from image data.
843 from image data.
845 For non-embedded images, you can just set the desired display width
844 For non-embedded images, you can just set the desired display width
846 and height directly.
845 and height directly.
847 unconfined: bool
846 unconfined : bool
848 Set unconfined=True to disable max-width confinement of the image.
847 Set unconfined=True to disable max-width confinement of the image.
849 metadata: dict
848 metadata : dict
850 Specify extra metadata to attach to the image.
849 Specify extra metadata to attach to the image.
851
850
852 Examples
851 Examples
853 --------
852 --------
854 # embedded image data, works in qtconsole and notebook
853 embedded image data, works in qtconsole and notebook
855 # when passed positionally, the first arg can be any of raw image data,
854 when passed positionally, the first arg can be any of raw image data,
856 # a URL, or a filename from which to load image data.
855 a URL, or a filename from which to load image data.
857 # The result is always embedding image data for inline images.
856 The result is always embedding image data for inline images.
858 Image('http://www.google.fr/images/srpr/logo3w.png')
857
859 Image('/path/to/image.jpg')
858 >>> Image('http://www.google.fr/images/srpr/logo3w.png')
860 Image(b'RAW_PNG_DATA...')
859 <IPython.core.display.Image object>
861
860
862 # Specifying Image(url=...) does not embed the image data,
861 >>> Image('/path/to/image.jpg')
863 # it only generates `<img>` tag with a link to the source.
862 <IPython.core.display.Image object>
864 # This will not work in the qtconsole or offline.
863
865 Image(url='http://www.google.fr/images/srpr/logo3w.png')
864 >>> Image(b'RAW_PNG_DATA...')
865 <IPython.core.display.Image object>
866
867 Specifying Image(url=...) does not embed the image data,
868 it only generates ``<img>`` tag with a link to the source.
869 This will not work in the qtconsole or offline.
870
871 >>> Image(url='http://www.google.fr/images/srpr/logo3w.png')
872 <IPython.core.display.Image object>
866
873
867 """
874 """
868 if isinstance(data, (Path, PurePath)):
875 if isinstance(data, (Path, PurePath)):
@@ -1053,8 +1060,7 b' class Video(DisplayObject):'
1053 Local files can be displayed with URLs without embedding the content, via::
1060 Local files can be displayed with URLs without embedding the content, via::
1054
1061
1055 Video('./video.mp4')
1062 Video('./video.mp4')
1056
1063 mimetype : unicode
1057 mimetype: unicode
1058 Specify the mimetype for embedded videos.
1064 Specify the mimetype for embedded videos.
1059 Default will be guessed from file extension, if available.
1065 Default will be guessed from file extension, if available.
1060 width : int
1066 width : int
@@ -1071,7 +1077,6 b' class Video(DisplayObject):'
1071
1077
1072 Examples
1078 Examples
1073 --------
1079 --------
1074
1075 ::
1080 ::
1076
1081
1077 Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4')
1082 Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4')
@@ -1165,7 +1170,7 b' def set_matplotlib_formats(*formats, **kwargs):'
1165 ----------
1170 ----------
1166 *formats : strs
1171 *formats : strs
1167 One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
1172 One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
1168 **kwargs :
1173 **kwargs
1169 Keyword args will be relayed to ``figure.canvas.print_figure``.
1174 Keyword args will be relayed to ``figure.canvas.print_figure``.
1170 """
1175 """
1171 from IPython.core.interactiveshell import InteractiveShell
1176 from IPython.core.interactiveshell import InteractiveShell
@@ -70,13 +70,13 b' class Audio(DisplayObject):'
70 ... framerate = 44100
70 ... framerate = 44100
71 ... t = np.linspace(0,5,framerate*5)
71 ... t = np.linspace(0,5,framerate*5)
72 ... data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t)
72 ... data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t)
73 ... Audio(data,rate=framerate)
73 ... Audio(data, rate=framerate)
74
74
75 Can also do stereo or more channels
75 Can also do stereo or more channels
76
76
77 >>> dataleft = np.sin(2*np.pi*220*t)
77 >>> dataleft = np.sin(2*np.pi*220*t)
78 ... dataright = np.sin(2*np.pi*224*t)
78 ... dataright = np.sin(2*np.pi*224*t)
79 ... Audio([dataleft, dataright],rate=framerate)
79 ... Audio([dataleft, dataright], rate=framerate)
80
80
81 From URL:
81 From URL:
82
82
General Comments 0
You need to be logged in to leave comments. Login now