跳转至

Slate

How can I plot multiple stacked areas on one chart so they overlay on top of each other?

You can plot stacked areas that overlay by using multiple X-axes, one for each collection of stacked areas, and then hiding the additional X-axes.

Timestamp: March 21, 2024

How can I retrieve and handle an object set in Slate that was passed through from a Workshop module via an iframe widget, especially when dealing with a large number of objects?

To retrieve and handle an object set in Slate that was passed through from a Workshop module via an iframe widget, follow these steps:

  1. Use slate.getMessage to get the filter payload. The code snippet for this step is:
    const payload = {{slEventValue}};
    return payload["workshop_variable_name"]
    
  2. Set a Slate variable with the payload for the filter spec.
  3. Query the object set service with the following body, replacing {{slate_var}} with your variable name:
    {
        objectSet: "{{slate_var}}",
        pageSize: 50
    }
    
    This will return a list of RIDs (resource identifiers).
  4. Use a TypeScript function to retrieve your objects with all properties. The code snippet for this step is:

Objects().search().yourObject(listOfRids).allAsync()

Note that there is a 100,000 object limit for Objects().search(). If your object set is larger than the pageSize, you'll need to handle pagination by creating a function to go through each paged result. The pageSize can be adjusted based on the number of objects you expect to retrieve and what can be handled by the object service and a user's network.

Timestamp: March 27, 2024

Why isn't the query running when called from a function, despite running successfully through the UI?

To make the query run when called from a function, you need to either enable "Automatically run this query when the app loads and when its dependencies change" in the query's configuration, or configure an action that triggers the query using Slate events.

Timestamp: March 6, 2024

How can a user show all available favorite application icons in Slate?

While there is no native Slate solution, a possible workaround is to use the resource widget in Workshop and embed it in Slate via an iframe.

Timestamp: April 12, 2024

How can I display attached Ontology images in Slate using the attachment RID?

To display attached Ontology images in Slate using the attachment RID, you can use the Blobster Salt API to get a URL that points to the image, and then put that URL into an <img> HTML component. For example, you can replace ri.blobster.main.image... with the Blobster RID of the image to get a URL that you can use in an <img> HTML component.

Timestamp: March 27, 2024

How can users upload an external library like D3.js for use in Slate Functions?

Users can add their own libraries on a per-app basis in the Functions panel, while the Admin Panel is for uploading libraries that are available to all users and apps.

Timestamp: March 6, 2024

What is the best way to embed a single button built in Slate into a Workshop application and adjust the dimensions between the Slate canvas, the button, and the Workshop widget?

You could try different styling options in Slate, such as the iframe and button width, and the styling in Workshop, like widget width/height until the desired output is achieved. If the canvas is too large, you can set the styling on the canvas in Slate to disable scrolling with the following CSS: sl-app-canvas { overflow: hidden; }.

Timestamp: February 29, 2024

What materials or resources can help a team quickly learn Slate, especially for non-technical members?

The training available in the Palantir Learning Slate course ↗ is recommended for a quick introduction to Slate and is suitable for non-technical members.

Timestamp: March 21, 2024

How can I implement a real-time countdown timer in Slate that updates every second?

To implement a real-time countdown timer in Slate that updates every second, you can create a dummy query and configure it to rerun every second. Then, set up a Slate event that is triggered by the query run, which triggers a "run" action on the function. Alternatively, you can use JavaScript's setInterval method to create a countdown timer that updates every second.

Timestamp: March 27, 2024

How can I change a line in a line chart from solid to dashed using CSS?

To change a line in a line chart from solid to dashed, you can create a CSS class and apply the 'stroke-dasharray' property to it. Here's an example of the CSS code you could use:

.myCSSClassForLine {
 stroke-dasharray: 4 1 2;
}

Then, you need to ensure that this class is applied only to the specific line you want to be dashed by using the correct selector. You may need to inspect the HTML to find the ID or class of that particular line. Both the dataset name and the series get added as classes, which can be used for targeting the specific line.

Timestamp: April 5, 2024

How can I reference the x or y value in custom tool tips in the chart widget to customize it, such as showing 'y value: {{value}}'?

Examine the Handlebar values for the widget; the desired values will look like Value: {{w_chart_1.hover.yValue}}.

Timestamp: April 3, 2024

The map widget in Slate fails to recognize the JSON string stored in an object property and throws the error message "Please enter valid json". How can this be fixed?

The problem can be solved by declaring a function in the Slate application that parses the JSON. For example, return {{object.property}}.map(str => JSON.parse(str)). The parsed value can then be used in the map widget.

Timestamp: March 6, 2024

Is it possible to apply different colors to specific pairs of points in a scatter plot in Slate?

Yes, it is possible to apply different colors to specific pairs of points in a scatter plot in Slate by using the Series Names corresponding to the points. This will allow you to assign different colors to each series.

Timestamp: February 27, 2024

How can I resolve the Invalid JSON error when using handlebars to specify inputs to Functions in a Slate application?

To resolve the Invalid JSON error, surround the handlebars expression with double quotations. Example: "{{variable_name}}".

Timestamp: July 10, 2024

How to resolve the "Multipage Slate applications are not supported" error when you try to package a Slate application for Marketplace?

The error is usually raised for Shared variables. To resolve the error, ensure the variables are Local.

Timestamp: June 24, 2024

How can I embed a Workshop application into a Slate application and pass variables to the Workshop application?

You can use the iFrame widget in Slate to embed a Workshop application. Make sure to append ?embedded=true at the end of the URL. To pass promoted variables, you can include them as URL parameters.

Timestamp: May 30, 2024

What are the limitations of using public Slate applications as request forms in Foundry?

Public Slate applications in Foundry only support writing data, not reading from Foundry. All data must be static and manually entered. Additionally, external Slate applications are unable to utilize the Ontology SDK.

Timestamp: May 19, 2024

How can I duplicate a Slate application?

A Slate application can be duplicated from File -> Save As.

Timestamp: July 31, 2024

How do I redirect to relative URLs in Slate?

A feature has been recently released where you can access the base URL via {{$global.window.origin}} and use it to construct your redirect URL. Alternatively, you can use JavaScript to dynamically get the base URL by running window.location.origin, and then construct your full URL for redirection. This can be done by creating a small invisible code sandbox that runs on Slate load and returns the value to a variable.

Timestamp: July 25, 2024

In Slate, how can I highlight a specific subset of td elements?

You can highlight specific td elements by using a custom CSS like below:

tr td:first-child {
    background-color: rgb(245, 248, 250);
    width: 5px
}

td:first-child, th:first-child {
    width: 10px !important;
}

td:nth-child(2), th:nth-child(2) {
    width: 200px !important;
}

Timestamp: July 24, 2024

How do I remove the left side panel on a Slate application in standalone mode?

You can remove the left side panel on a Slate application in standalone mode by adding the following CSS rule to your styles:

sl-app-chrome {
    display: none; 
}

Timestamp: July 18, 2024

Is there any difference between Slate OSDK and Functions OSDK, or are they intrinsically the same?

OSDK in Slate uses the same engine on the backend as the Functions OSDK. The difference lies in a tighter integration with Slate's variables, events, and actions framework, allowing for more complex interactions within a Slate application.

Timestamp: August 2, 2024

In Slate, is it possible to pre-fill a dropdown menu with Ontology objects?

The format of the raw data to pre-fill a dropdown menu depends on what you want to populate the dropdown menu with. However, it is currently not possible to render mini object options with an icon and hover state in the dropdown widget.

Timestamp: July 24, 2024

Will a query automatically rerun if the input changes?

Yes; by default, functions, queries, and widgets will re-run when their dependencies change. You can override this for the Queries using the configuration panel. An alternative method would be to trigger a re-calculation from an event, such as a button press. Use the events configuration panel in order to configure this.

Timestamp: September 9, 2024

Is it possible to package a Slate application that uses a Code Sandbox widget in Marketplace?

Yes, Slate supports packaging the Code Sandbox widget with JavaScript/CSS libraries in Marketplace following the usual Marketplace/DevOps process.

Timestamp: November 25, 2024


中文翻译

Slate

如何在一个图表上绘制多个堆叠区域,使它们相互重叠?

您可以通过使用多个X轴(每个堆叠区域集合对应一个X轴)来绘制重叠的堆叠区域,然后隐藏额外的X轴。

时间戳: 2024年3月21日

如何通过iframe小部件从Workshop模块传递的对象集(object set)在Slate中检索和处理,尤其是在处理大量对象时?

要通过iframe小部件从Workshop模块传递的对象集在Slate中检索和处理,请按照以下步骤操作:

  1. 使用 slate.getMessage 获取过滤器负载(filter payload)。此步骤的代码片段为:
    const payload = {{slEventValue}};
    return payload["workshop_variable_name"]
    
  2. 使用过滤器规范的负载设置一个Slate变量。
  3. 使用以下主体查询对象集服务(object set service),将 {{slate_var}} 替换为您的变量名:
    {
        objectSet: "{{slate_var}}",
        pageSize: 50
    }
    
    这将返回一个RID(资源标识符)列表。
  4. 使用TypeScript函数检索包含所有属性的对象。此步骤的代码片段为:

Objects().search().yourObject(listOfRids).allAsync()

请注意,Objects().search() 有100,000个对象的限制。如果您的对象集大于 pageSize,则需要通过创建一个函数来处理每个分页结果来实现分页。pageSize 可以根据您预期检索的对象数量以及对象服务和用户网络能够处理的数量进行调整。

时间戳: 2024年3月27日

为什么通过函数调用时查询不运行,尽管通过UI运行成功?

要使通过函数调用时查询能够运行,您需要在查询配置中启用"应用加载时及其依赖项更改时自动运行此查询",或者配置一个使用Slate事件触发查询的操作(action)。

时间戳: 2024年3月6日

用户如何在Slate中显示所有可用的收藏应用程序图标?

虽然没有原生的Slate解决方案,但一种可能的变通方法是使用Workshop中的资源小部件(resource widget),并通过iframe将其嵌入到Slate中。

时间戳: 2024年4月12日

如何使用附件RID在Slate中显示附加的本体(Ontology)图像?

要使用附件RID在Slate中显示附加的本体图像,您可以使用Blobster Salt API获取指向该图像的URL,然后将该URL放入<img> HTML组件中。例如,您可以将 ri.blobster.main.image... 替换为图像的Blobster RID,以获取可在<img> HTML组件中使用的URL。

时间戳: 2024年3月27日

用户如何上传像D3.js这样的外部库以便在Slate函数(Slate Functions)中使用?

用户可以在函数面板中按应用添加自己的库,而管理面板(Admin Panel)则用于上传可供所有用户和应用使用的库。

时间戳: 2024年3月6日

将Slate中构建的单个按钮嵌入到Workshop应用程序中,并调整Slate画布、按钮和Workshop小部件之间的尺寸,最佳方法是什么?

您可以尝试Slate中的不同样式选项,例如iframe和按钮宽度,以及Workshop中的样式,如小部件宽度/高度,直到达到所需效果。如果画布太大,您可以在Slate中设置画布样式以禁用滚动,使用以下CSS:sl-app-canvas { overflow: hidden; }

时间戳: 2024年2月29日

有哪些材料或资源可以帮助团队快速学习Slate,特别是对于非技术成员?

推荐参加 Palantir Learning Slate课程 ↗ 中的培训,该课程适合快速了解Slate,也适合非技术成员学习。

时间戳: 2024年3月21日

如何在Slate中实现每秒更新的实时倒计时器?

要在Slate中实现每秒更新的实时倒计时器,您可以创建一个虚拟查询(dummy query)并将其配置为每秒重新运行。然后,设置一个由查询运行触发的Slate事件,该事件触发函数的"运行"操作。或者,您可以使用JavaScript的setInterval方法创建一个每秒更新的倒计时器。

时间戳: 2024年3月27日

如何使用CSS将折线图中的实线改为虚线?

要将折线图中的实线改为虚线,您可以创建一个CSS类并对其应用'stroke-dasharray'属性。以下是您可以使用的CSS代码示例:

.myCSSClassForLine {
 stroke-dasharray: 4 1 2;
}

然后,您需要确保通过使用正确的选择器,该类仅应用于您想要变为虚线的特定线条。您可能需要检查HTML以找到该特定线条的ID或类。数据集名称和系列都会作为类添加,可用于定位特定线条。

时间戳: 2024年4月5日

如何在图表小部件的自定义工具提示中引用x或y值以进行自定义,例如显示'y值:{{value}}'?

检查小部件的Handlebars值;所需的值看起来像 Value: {{w_chart_1.hover.yValue}}

时间戳: 2024年4月3日

Slate中的地图小部件无法识别存储在对象属性中的JSON字符串,并抛出错误消息"请输入有效的json"。如何解决此问题?

可以通过在Slate应用程序中声明一个解析JSON的函数来解决此问题。例如,return {{object.property}}.map(str => JSON.parse(str))。然后可以在地图小部件中使用解析后的值。

时间戳: 2024年3月6日

是否可以在Slate的散点图中为特定的点对应用不同的颜色?

是的,可以在Slate的散点图中为特定的点对应用不同的颜色,方法是使用与点对应的"系列名称"(Series Names)。这将允许您为每个系列分配不同的颜色。

时间戳: 2024年2月27日

如何在Slate应用程序中使用Handlebars指定函数输入时解决"无效JSON"错误?

要解决"无效JSON"错误,请将Handlebars表达式用双引号括起来。示例:"{{variable_name}}"

时间戳: 2024年7月10日

尝试将Slate应用程序打包到Marketplace时,如何解决"不支持多页Slate应用程序"错误?

该错误通常由"共享"(Shared)变量引起。要解决此错误,请确保变量是"本地"(Local)的。

时间戳: 2024年6月24日

如何将Workshop应用程序嵌入到Slate应用程序中,并将变量传递给Workshop应用程序?

您可以使用Slate中的iFrame小部件嵌入Workshop应用程序。确保在URL末尾附加 ?embedded=true。要传递提升的变量(promoted variables),您可以将其作为URL参数包含在内。

时间戳: 2024年5月30日

在Foundry中使用公共Slate应用程序作为请求表单有哪些限制?

Foundry中的公共Slate应用程序仅支持写入数据,不支持从Foundry读取数据。所有数据必须是静态的并手动输入。此外,外部Slate应用程序无法使用本体SDK(Ontology SDK)。

时间戳: 2024年5月19日

如何复制Slate应用程序?

可以通过 文件 -> 另存为 来复制Slate应用程序。

时间戳: 2024年7月31日

如何在Slate中重定向到相对URL?

最近发布了一项功能,您可以通过 {{$global.window.origin}} 访问基础URL,并使用它来构建您的重定向URL。或者,您可以使用JavaScript通过运行 window.location.origin 动态获取基础URL,然后构建完整的URL进行重定向。这可以通过创建一个在Slate加载时运行并返回值到变量的不可见小型代码沙箱(code sandbox)来实现。

时间戳: 2024年7月25日

在Slate中,如何高亮显示特定的td元素子集?

您可以使用如下自定义CSS来高亮显示特定的td元素:

tr td:first-child {
    background-color: rgb(245, 248, 250);
    width: 5px
}

td:first-child, th:first-child {
    width: 10px !important;
}

td:nth-child(2), th:nth-child(2) {
    width: 200px !important;
}

时间戳: 2024年7月24日

如何在独立模式下移除Slate应用程序的左侧面板?

您可以通过在样式中添加以下CSS规则来移除独立模式下Slate应用程序的左侧面板:

sl-app-chrome {
    display: none; 
}

时间戳: 2024年7月18日

Slate OSDK和Functions OSDK之间有什么区别,还是它们本质上是相同的?

Slate中的OSDK在后台使用与Functions OSDK相同的引擎。区别在于它与Slate的变量、事件和操作框架有更紧密的集成,允许在Slate应用程序中进行更复杂的交互。

时间戳: 2024年8月2日

在Slate中,是否可以用本体对象预填充下拉菜单?

预填充下拉菜单的原始数据格式取决于您想要在下拉菜单中填充的内容。但是,目前无法在下拉小部件中呈现带有图标和悬停状态的迷你对象选项。

时间戳: 2024年7月24日

如果输入发生变化,查询会自动重新运行吗?

是的;默认情况下,函数、查询和小部件会在其依赖项发生变化时重新运行。您可以使用配置面板覆盖查询的此行为。另一种方法是从事件(如按钮按下)触发重新计算。使用事件配置面板进行配置。

时间戳: 2024年9月9日

是否可以将使用代码沙箱小部件的Slate应用程序打包到Marketplace中?

是的,Slate支持按照常规的Marketplace/DevOps流程,将包含JavaScript/CSS库的代码沙箱小部件打包到Marketplace中。

时间戳: 2024年11月25日