Tableau Server Client (TSC)
中ImageRequestOptions
的用法。
用法
ImageRequestOptions(imageresolution=None, maxage=-1)
使用這個類來指定視圖的分辨率,以及(可選)緩存在服務器上的圖像的最大年齡。您還可以使用此類指定生成圖像時要應用的視圖過濾器。請參閱views.populate_image
。
屬性
名字 | 說明 |
---|---|
imageresolution |
作為圖像返回的視圖的分辨率。如果未指定,views.populate_image 方法返回標準分辨率的圖像(返回圖像的寬度為 784 像素)。如果將此參數值設置為高(Resolution.High ),則返回圖像的寬度為 1568 像素。對於這兩種分辨率,高度都會變化以保持視圖的縱橫比。 |
maxage |
可選的。圖像在刷新之前將在服務器上緩存的最大分鍾數。該值必須是介於 1 和 240 分鍾之間的整數。 0 在服務器上將被解釋為 1 分鍾,因為這是允許的最短間隔。默認情況下,maxage 設置為 -1 ,表示服務器設置中配置的默認行為。 |
查看過濾器
您可以使用vf('filter_name', 'filter_value')
方法添加視圖過濾器。生成圖像時,指定的過濾器將應用於視圖。
示例
# import tableauserverclient as TSC
# server = TSC.Server('https://MY-SERVER')
# sign in, get a specific view, etc.
# set the image request option
image_req_option = TSC.ImageRequestOptions(imageresolution=TSC.ImageRequestOptions.Resolution.High, maxage=1)
# (optional) set a view filter
image_req_option.vf('Category', 'Furniture')
# retrieve the image for the view
server.views.populate_image(view_item, image_req_option)
相關用法
- Python PIL Image.draft()用法及代碼示例
- Python PIL Image.thumbnail()用法及代碼示例
- Python PIL Image.new()用法及代碼示例
- Python PIL ImageOps.fit()用法及代碼示例
- Python Wand Image()用法及代碼示例
- Python PIL ImageDraw.Draw.rectangle()用法及代碼示例
- Python PIL ImageEnhance.Color() and ImageEnhance.Contrast()用法及代碼示例
- Python PIL Image.getdata()用法及代碼示例
- Python PIL ImageFont.truetype()用法及代碼示例
- Python PIL ImagePath.Path.tolist()用法及代碼示例
- Python PIL Image.transform()用法及代碼示例
- Python PIL Image.quantize()用法及代碼示例
- Python PIL Image.point()用法及代碼示例
- Python PIL Image.frombuffer()用法及代碼示例
- Python PIL ImageDraw.Draw.text()用法及代碼示例
- Python PIL ImageOps.expand()用法及代碼示例
- Python PIL ImageSequence.Iterator()用法及代碼示例
- Python PIL ImageOps.colorize()用法及代碼示例
- Python PIL ImageGrab.grabclipboard()用法及代碼示例
- Python PIL ImageChops.screen() and ImageChops.offset()用法及代碼示例
- Python PIL Image.transpose()用法及代碼示例
- Python PIL Image.tell()用法及代碼示例
- Python PIL ImageChops.multiply()用法及代碼示例
- Python Image轉PDF用法及代碼示例
- Python PIL Image.save()用法及代碼示例
注:本文由純淨天空篩選整理自tableau.github.io大神的英文原創作品 ImageRequestOptions class。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。