# Heatmap Rendering Logic

Ptengine's attention heatmap determines colors based on relative user dwell time. Specifically, it uses the following formula and three rendering rules to determine the colors.

#### Attention Color Calculation Formula <a href="#zhu-yi-li-yan-se-ji-suan-gong-shi" id="zhu-yi-li-yan-se-ji-suan-gong-shi"></a>

![Attention Color Calculation Formula](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/%E5%85%AC%E5%BC%8F.png)

Based on the formula above, areas exceeding 90% appear nearly red, then transition to orange, yellow, yellow-green, and blue, while areas at 0% are transparent.

![Color Transition Example](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/heatmap_attention_01.png)

**Three Rendering Rules**

1. **Attention converges toward the center of the browser viewport**![Rule 1](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/heatmap_attention_02-1024x580.png)
2. **Areas where users stop scrolling overlap and turn red**![Rule 2](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/heatmap_attention_03-1024x547.png)
3. **Colors are drawn based on the user's longest dwell position**![Rule 3](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/heatmap_attention_04-1024x499.png)

As an additional note, based on the above explanation, if a specific part of the page is viewed significantly more than other parts (e.g., the viewing time difference exceeds 10x), the colors for the rest of the page may become extremely faint. In this case, you can adjust the red threshold by moving the adjustment slider on the heatmap screen to the left, making the heatmap easier to read. Please feel free to use this feature.

![Red Threshold Adjustment](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/FAQ/%E7%83%AD%E5%BA%A6%E8%B0%83%E8%8A%82.jpg)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/en/faq/others/heatmap-rendering-logic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
