feat: add hit position for gridContent
@@ -263,20 +263,31 @@ export class ChromosomeColumnRenderer {
this.columns
.lineStyle(config.chromosomeColumn.thickness, config.chromosomeColumn.lineColor, 0)
.beginFill(scoreConfig.color, 1);
- hits.forEach(hit => {
+ hits.forEach((hit, hitIndex) => {
const {
start,
end,
x
} = hit;
if (x <= this.hitsLimit) {
+ const startDrawPosX = initialMargin + (x - 1) * config.gridSize;
+ const startDrawPosY = start * config.gridSize;
+ const hitLength = (end - start) * config.gridSize - 1;
this.columns
.drawRect(
- initialMargin + (x - 1) * config.gridSize,
- start * config.gridSize,
+ startDrawPosX,
+ startDrawPosY,
config.gridSize - 1,
- (end - start) * config.gridSize - 1
+ hitLength
);
+ this.gridContent[chromosome.name][hitIndex].x_area = {
+ from: startDrawPosX,
+ to: startDrawPosX + config.gridSize - 1
+ };
+ this.gridContent[chromosome.name][hitIndex].y_area = {
+ from: startDrawPosY,
+ to: startDrawPosY + hitLength
+ };
}
});
this.columns
