本文整理汇总了Python中html.HTML.link方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.link方法的具体用法?Python HTML.link怎么用?Python HTML.link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html.HTML
的用法示例。
在下文中一共展示了HTML.link方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Chart
# 需要导入模块: from html import HTML [as 别名]
# 或者: from html.HTML import link [as 别名]
class Chart(object):
"""
Create and modify a chart.
Parameters
----------
name : str
The name of the chart. This will be the id of the div that holds the chart. Therefore no two charts in the
same document should have the same name.
local_jquery : str
Path to a local version of jquery. If not provided, one hosted on a CDN is used.
**Default:** None
local_requirejs : str
Path to a local version of requirejs. If not provided, one hosted on a CDN is used.
**Default:** None
local_d3_js : str
Path to a local version of d3js. If not provided, one hosted on a CDN is used.
**Default:** None
local_c3_js : str
Path to a local version of c3js. If not provided, one hosted on a CDN is used.
**Default:** None
local_c3_css : str
Path to a local version of c3's css. If not provided, one hosted on a CDN is used.
**Default:** None
Attributes
----------
axes : c3py.axes.Axes
data : c3py.data.Data
grid : c3py.grid.Grid
legend : c3py.legend.Legend
tooltip : c3py.tooltip.Tooltip
regions : c3py.regions.Regions
point : c3py.point.Point
size : c3py.size.Size
padding : c3py.padding.Padding
"""
def __init__(self, name, local_jquery=None, local_requirejs=None, local_d3_js=None, local_c3_js=None,
local_c3_css=None):
super(Chart, self).__init__()
self.chart_html = HTML()
self.name = name
self.c3_css_path = local_c3_css or 'https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.css'
self.jquery_path = local_jquery or 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'
self.requirejs_path = local_requirejs or \
'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js'
self.d3_js_path = local_d3_js or 'http://d3js.org/d3.v3.min'
self.c3_js_path = local_c3_js or 'https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min'
self.chart_html.div('', id=self.name)
self.chart_html.link('', href=self.c3_css_path, rel='stylesheet', type='text/css')
self.chart_html.script('', src=self.jquery_path)
self.chart_html.script('', src=self.requirejs_path)
self.requirejs_config = {
'paths': {
'c3': self.c3_js_path,
'd3': self.d3_js_path,
}
}
self.axes = Axes()
self.data = Data(self.axes)
self.grid = Grid(self.axes)
self.legend = Legend()
self.tooltip = Tooltip()
self.regions = Regions(self.axes)
self.point = Point()
self.size = Size()
self.padding = Padding()
#.........这里部分代码省略.........