Skip to content

Conversation

@hsorby
Copy link
Contributor

@hsorby hsorby commented Dec 18, 2025

No description provided.

return response
}
defineExpose({ getDataView })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why getDataView? Why not simply getData?

</template>

<script setup>
const emit = defineEmits(['data-ready'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use data-available (or dataAvailable).

Comment on lines +62 to +68
if (type === 'sine') {
// Smooth curve.
data.push(Math.sin(i * 0.1) * 10)
} else {
// Random noise.
data.push(Math.random() * 10)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add some mock data for the variable of integration?

Comment on lines +86 to +97
// Check request is expected type.
if (req.id !== EXPECTED_ID) {
console.warn(`[Mock] Request #${index} ignored: Invalid ID '${req.id}'`)
return // Skip this specific item.
}
// Test version compatibility.
const requestMajorVersion = parseInt(req.version.split('.')[0])
if (requestMajorVersion !== EXPECTED_MAJOR_VERSION) {
console.warn(`[Mock] Request #${index} ignored: Version mismatch. Expected v${EXPECTED_MAJOR_VERSION}.x, got v${req.version}`)
return // Skip this specific item.
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't bother with this, but... meh.

if (req.variable && req.variable.includes('v_in')) {
response[req.identifier] = generateMockSeries('sine')
} else {
// Default fallback for other variables.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also come here if req.variable is not truthy.

} else {
// Default fallback for other variables.
response[req.identifier] = generateMockSeries('random')
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect req.variable to be something like membrane/V or sodium_current/i_Na. As for the variable of integration, we could use VOI as a special variable name. So, here, I would expect to add a case for where req.variable === 'VOI'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants